diff options
author | 2020-08-10 06:20:50 -0400 | |
---|---|---|
committer | 2020-08-10 11:20:50 +0100 | |
commit | 4dd9e189c807e028a6c110b694251db02aa76d30 (patch) | |
tree | 622c115c63378e23c6f72d61661dfc8ea97a2496 /source/github-helpers/github-url.ts | |
parent | 31aa923b562f3436ec4dc4d2a0e1970a40d20830 (diff) | |
download | refined-github-4dd9e189c807e028a6c110b694251db02aa76d30.tar.gz refined-github-4dd9e189c807e028a6c110b694251db02aa76d30.tar.zst refined-github-4dd9e189c807e028a6c110b694251db02aa76d30.zip |
Preserve current branch in `forked-to` link when possible (#3420)
Co-authored-by: Federico <opensource@bfred.it>
Diffstat (limited to 'source/github-helpers/github-url.ts')
-rw-r--r-- | source/github-helpers/github-url.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/github-helpers/github-url.ts b/source/github-helpers/github-url.ts index 97c347a0..489f4f9e 100644 --- a/source/github-helpers/github-url.ts +++ b/source/github-helpers/github-url.ts @@ -67,7 +67,7 @@ export default class GitHubURL { } get pathname() { - return `/${this.user}/${this.repository}/${this.route}/${this.branch}/${this.filePath}`.replace(/\/+$/, ''); + return `/${this.user}/${this.repository}/${this.route}/${this.branch}/${this.filePath}`.replace(/((undefined)?\/)+$/g, ''); } set pathname(pathname) { |