Skip to content

Commit 64a3fc5

Browse files
committed
Fix no upstream at all when commit is undefined
Part of #3402
1 parent 15d81ee commit 64a3fc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/issues/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ function getSimpleUpstream(repository: Repository) {
463463
}
464464
}
465465

466-
async function getBestPossibleUpstream(repository: Repository, commit: Commit): Promise<Remote | undefined> {
466+
async function getBestPossibleUpstream(repository: Repository, commit: Commit | undefined): Promise<Remote | undefined> {
467467
const fallbackUpstream = new Promise<Remote | undefined>(resolve => {
468468
resolve(getSimpleUpstream(repository));
469469
});
@@ -515,7 +515,7 @@ export async function createGithubPermalink(
515515
commitHash = repository.state.HEAD?.commit;
516516
}
517517

518-
const upstream = commit ? await getBestPossibleUpstream(repository, commit) : undefined;
518+
const upstream = await getBestPossibleUpstream(repository, commit);
519519
if (!upstream || !upstream.fetchUrl) {
520520
return { permalink: undefined, error: 'The selection may not exist on any remote.', originalFile: uri };
521521
}

0 commit comments

Comments
 (0)