Skip to content

Commit 87449f5

Browse files
committed
Adds protection for deleted SHA
1 parent 5940b8b commit 87449f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hovers/hovers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { GitCommit } from '../git/models/commit';
1111
import type { GitLineDiff, ParsedGitDiffHunk } from '../git/models/diff';
1212
import type { PullRequest } from '../git/models/pullRequest';
1313
import type { GitRemote } from '../git/models/remote';
14-
import { uncommittedStaged } from '../git/models/revision';
14+
import { deletedOrMissing, uncommittedStaged } from '../git/models/revision';
1515
import type { RemoteProvider } from '../git/remotes/remoteProvider';
1616
import { isUncommittedStaged, shortenRevision } from '../git/utils/revision.utils';
1717
import { configuration } from '../system/-webview/configuration';
@@ -111,7 +111,7 @@ export async function changesMessage(
111111
message = `[$(compare-changes)](${DiffWithCommand.createMarkdownCommandLink(commit, range)} "Open Changes")`;
112112

113113
previousSha ??= await commit.getPreviousSha();
114-
if (previousSha) {
114+
if (previousSha && previousSha !== deletedOrMissing) {
115115
previous = `  [$(git-commit) ${shortenRevision(
116116
previousSha,
117117
)}](${ShowQuickCommitCommand.createMarkdownCommandLink(previousSha)} "Show Commit")  ${

0 commit comments

Comments
 (0)