Skip to content

Commit a333b4b

Browse files
committed
Fixes #3270 incorrectly identifying a worktree
1 parent 56af814 commit a333b4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands/git/switch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export class SwitchGitCommand extends QuickCommand<State> {
205205
state.reference.repoPath,
206206
w => w.branch?.name === state.reference!.name,
207207
);
208-
if (worktree != null) {
208+
if (worktree != null && !worktree.main) {
209209
if (state.fastForwardTo != null) {
210210
state.repos[0].merge('--ff-only', state.fastForwardTo.ref);
211211
}

0 commit comments

Comments
 (0)