Skip to content

Commit b69e4fc

Browse files
authored
Git - fix default worktree path when creating a worktree in a worktree (#286210)
1 parent a967622 commit b69e4fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/git/src/commands.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3600,7 +3600,9 @@ export class CommandCenter {
36003600
const defaultWorktreeRoot = this.globalState.get<string>(`${Repository.WORKTREE_ROOT_STORAGE_KEY}:${repository.root}`);
36013601
const defaultWorktreePath = defaultWorktreeRoot
36023602
? path.join(defaultWorktreeRoot, worktreeName)
3603-
: path.join(path.dirname(repository.root), `${path.basename(repository.root)}.worktrees`, worktreeName);
3603+
: repository.kind === 'worktree'
3604+
? path.join(path.dirname(repository.root), worktreeName)
3605+
: path.join(path.dirname(repository.root), `${path.basename(repository.root)}.worktrees`, worktreeName);
36043606

36053607
const disposables: Disposable[] = [];
36063608
const inputBox = window.createInputBox();

0 commit comments

Comments
 (0)