diff --git a/source/features/deep-reblame.tsx b/source/features/deep-reblame.tsx index a80e61645ed..ee86d807096 100644 --- a/source/features/deep-reblame.tsx +++ b/source/features/deep-reblame.tsx @@ -12,7 +12,7 @@ import GitHubURL from '../github-helpers/github-url'; import LoadingIcon from '../github-helpers/icon-loading'; import looseParseInt from '../helpers/loose-parse-int'; -const getPullRequestBlameCommit = mem(async (commit: string, prNumber: number, currentFilename: string): Promise => { +const getPullRequestBlameCommit = mem(async (commit: string, prNumbers: number[], currentFilename: string): Promise => { const {repository} = await api.v4(` repository() { file: object(expression: "${commit}:${currentFilename}") { @@ -42,7 +42,7 @@ const getPullRequestBlameCommit = mem(async (commit: string, prNumber: number, c const associatedPR = repository.object.associatedPullRequests.nodes[0]; - if (!associatedPR || associatedPR.number !== prNumber || associatedPR.mergeCommit.oid !== commit) { + if (!associatedPR || !prNumbers.includes(associatedPR.number) || associatedPR.mergeCommit.oid !== commit) { throw new Error('The PR linked in the title didn’t create this commit'); } @@ -63,7 +63,7 @@ async function redirectToBlameCommit(event: delegate.Event looseParseInt(pr)); const prCommit = select('a.message', blameHunk)!.pathname.split('/').pop()!; const blameUrl = new GitHubURL(location.href); @@ -71,7 +71,7 @@ async function redirectToBlameCommit(event: delegate.Event