Skip to content

Commit 5592612

Browse files
committed
Adds "type" to commit search quickpick
1 parent d798bfd commit 5592612

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/commands/git/search.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export class SearchGitCommand extends QuickCommand<State> {
226226
log: await context.resultsPromise,
227227
onDidLoadMore: log => (context.resultsPromise = Promise.resolve(log)),
228228
placeholder: (_context, log) =>
229-
log == null
229+
!log?.commits.size
230230
? `No results for ${state.query}`
231231
: `${pluralize('result', log.count, {
232232
format: c => (log.hasMore ? `${c}+` : String(c)),
@@ -343,6 +343,14 @@ export class SearchGitCommand extends QuickCommand<State> {
343343
alwaysShow: true,
344344
item: 'change:' as const,
345345
},
346+
context.hasVirtualFolders
347+
? undefined
348+
: {
349+
label: searchOperatorToTitleMap.get('type:')!,
350+
description: 'type: stash or is: stash',
351+
alwaysShow: true,
352+
item: 'type:' as const,
353+
},
346354
].filter(<T>(i?: T): i is T => i != null);
347355

348356
const matchCaseButton = new MatchCaseToggleQuickInputButton(state.matchCase);

src/commands/quickCommand.steps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ export async function* pickCommitStep<
11241124
},
11251125
): AsyncStepResultGenerator<GitCommit> {
11261126
async function getItems(log: GitLog | undefined) {
1127-
if (log == null) {
1127+
if (!log?.commits.size) {
11281128
return [createDirectiveQuickPickItem(Directive.Back, true), createDirectiveQuickPickItem(Directive.Cancel)];
11291129
}
11301130

0 commit comments

Comments
 (0)