Skip to content

Commit 90e460f

Browse files
committed
Excludes worktrees from commit search command
Optimizes repo selection for single repo scenarios
1 parent 1888236 commit 90e460f

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
@@ -1605,6 +1605,8 @@ export async function* pickRepositoryStep<
16051605
repos = sortRepositoriesGrouped(grouped);
16061606
}
16071607

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

16101612
const step = createPickStep<RepositoryQuickPickItem>({

0 commit comments

Comments
 (0)