We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94ee94c commit 0cfc992Copy full SHA for 0cfc992
src/StashNode/NodeFactory.ts
@@ -21,11 +21,15 @@ export default class NodeFactory {
21
// May be undefined if the directory is not part of the workspace,
22
// this happens on upper directories by negative search depth setting.
23
const wsFolder = workspace.getWorkspaceFolder(Uri.file(path))
24
+ // In a root dir, the received path is contained in the workspace's path.
25
+ const isRoot = wsFolder?.uri.fsPath.includes(path) ?? false
26
+ console.log(`createRepositoryNode() ${path}`, wsFolder?.uri)
27
28
return new RepositoryNode(
29
dirname(path),
30
basename(path),
- wsFolder?.name,
31
+ // wsFolder is defined when isRoot is true but TS cannot infer that so add a ?
32
+ isRoot ? wsFolder?.name : undefined,
33
)
34
}
35
0 commit comments