From c3049d5adb51ef63e7469d293a4f6a5c1aa9d1e4 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 17 Feb 2022 00:00:59 -0500 Subject: [PATCH] Filters main worktree from delete --- src/commands/git/worktree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/git/worktree.ts b/src/commands/git/worktree.ts index 814ccc3..4d2c00a 100644 --- a/src/commands/git/worktree.ts +++ b/src/commands/git/worktree.ts @@ -545,7 +545,7 @@ export class WorktreeGitCommand extends QuickCommand { context.title = getTitle('Worktrees', state.subcommand); const result = yield* pickWorktreesStep(state, context, { - filter: wt => !wt.opened, // Can't delete an open worktree + filter: wt => wt.main || !wt.opened, // Can't delete the main or opened worktree includeStatus: true, picked: state.uris?.map(uri => uri.toString()), placeholder: 'Choose worktrees to delete',