Skip to content

Commit da72e40

Browse files
committed
Merge pull request #112 from DrewML/issue104
Fix broken patch/diff links on commit PRs. Fixes #104
2 parents a342c94 + 84e2c49 commit da72e40

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

extension/content.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ function linkifyIssuesInTitles() {
270270
}
271271

272272
function addPatchDiffLinks() {
273-
const commitUrl = location.href.replace(/\/$/, '');
273+
let commitUrl = location.href.replace(/\/$/, '');
274+
if (isPRCommit()) {
275+
commitUrl = commitUrl.replace(/\/pull\/\d+\/commits/, '/commit');
276+
}
274277
const commitMeta = $('.commit-meta span.right').get(0);
275278

276279
$(commitMeta).append(`

0 commit comments

Comments
 (0)