Skip to content

Commit f94e6e3

Browse files
committed
Updates explain commit picker
1 parent c536cd0 commit f94e6e3

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/commands/explainCommit.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Container } from '../container';
44
import { GitUri } from '../git/gitUri';
55
import { showGenericErrorMessage } from '../messages';
66
import type { AIExplainSource } from '../plus/ai/aiProviderService';
7-
import { ReferencesQuickPickIncludes, showReferencePicker } from '../quickpicks/referencePicker';
7+
import { showCommitPicker } from '../quickpicks/commitPicker';
88
import { getBestRepositoryOrShowPicker } from '../quickpicks/repositoryPicker';
99
import { command } from '../system/-webview/command';
1010
import { showMarkdownPreview } from '../system/-webview/markdown';
@@ -63,18 +63,11 @@ export class ExplainCommitCommand extends GlCommandBase {
6363
try {
6464
// If no ref is provided, show a picker to select a commit
6565
if (args.ref == null) {
66-
const pick = await showReferencePicker(
67-
repository.path,
68-
'Explain Commit',
69-
'Choose a commit to explain',
70-
{
71-
allowRevisions: true,
72-
include: ReferencesQuickPickIncludes.BranchesAndTags,
73-
sort: { branches: { current: true }, tags: {} },
74-
},
75-
);
76-
if (pick?.ref == null) return;
77-
args.ref = pick.ref;
66+
const commitsProvider = repository.git.commits();
67+
const log = await commitsProvider.getLog();
68+
const pick = await showCommitPicker(log, 'Explain Commit', 'Choose a commit to explain');
69+
if (pick?.sha == null) return;
70+
args.ref = pick.sha;
7871
}
7972

8073
// Get the commit

0 commit comments

Comments
 (0)