Skip to content

Commit 3384b6f

Browse files
committed
Excludes worktrees from commit search command
Optimizes repo selection for single repo scenarios
1 parent 50e49a4 commit 3384b6f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/commands/git/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class SearchGitCommand extends QuickCommand<State> {
166166

167167
state.repo = context.repos[0];
168168
} else {
169-
const result = yield* pickRepositoryStep(state, context);
169+
const result = yield* pickRepositoryStep(state, context, { excludeWorktrees: true });
170170
// Always break on the first step (so we will go back)
171171
if (result === StepResultBreak) break;
172172

src/commands/quickCommand.steps.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,8 @@ export async function* pickRepositoryStep<
16041604
repos = sortRepositoriesGrouped(grouped);
16051605
}
16061606

1607+
if (repos.length === 1) return repos[0];
1608+
16071609
const placeholder = options?.placeholder ?? 'Choose a repository';
16081610

16091611
const step = createPickStep<RepositoryQuickPickItem>({

0 commit comments

Comments
 (0)