From 92bd405bbeb63c4f591452db08da508696bb3647 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 15 Jun 2020 04:07:41 -0400 Subject: [PATCH] Uses getCommit rather than getLog --- src/commands/showQuickCommit.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/commands/showQuickCommit.ts b/src/commands/showQuickCommit.ts index 05b018d..96313ba 100644 --- a/src/commands/showQuickCommit.ts +++ b/src/commands/showQuickCommit.ts @@ -100,24 +100,17 @@ export class ShowQuickCommitCommand extends ActiveEditorCachedCommand { if (args.repoLog != null) { args.commit = args.repoLog.commits.get(args.sha); // If we can't find the commit, kill the repoLog - if (args.commit === undefined) { + if (args.commit == null) { args.repoLog = undefined; } } - if (args.repoLog === undefined) { - const log = await Container.git.getLog(repoPath!, { limit: 2, ref: args.sha }); - if (log === undefined) { - void Messages.showCommitNotFoundWarningMessage('Unable to show commit'); - - return; - } - - args.commit = log.commits.get(args.sha); + if (args.repoLog == null) { + args.commit = await Container.git.getCommit(repoPath!, args.sha); } } - if (args.commit === undefined) { + if (args.commit == null) { void Messages.showCommitNotFoundWarningMessage('Unable to show commit'); return;