diff options
Diffstat (limited to 'source/features/patch-diff-links.tsx')
-rw-r--r-- | source/features/patch-diff-links.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/features/patch-diff-links.tsx b/source/features/patch-diff-links.tsx index 1c434a3c..79d2ce25 100644 --- a/source/features/patch-diff-links.tsx +++ b/source/features/patch-diff-links.tsx @@ -3,10 +3,12 @@ import select from 'select-dom'; import * as pageDetect from 'github-url-detection'; import features from '.'; +import {getCleanPathname} from '../github-helpers'; function init(): void { - let commitUrl = location.pathname.replace(/\/$/, ''); + let commitUrl = '/' + getCleanPathname(); + // Avoids a redirection if (pageDetect.isPRCommit()) { commitUrl = commitUrl.replace(/\/pull\/\d+\/commits/, '/commit'); } |