summaryrefslogtreecommitdiff
path: root/source/github-helpers/github-url.ts
diff options
context:
space:
mode:
authorGravatar yakov116 <16872793+yakov116@users.noreply.github.com> 2020-08-10 06:20:50 -0400
committerGravatar GitHub <noreply@github.com> 2020-08-10 11:20:50 +0100
commit4dd9e189c807e028a6c110b694251db02aa76d30 (patch)
tree622c115c63378e23c6f72d61661dfc8ea97a2496 /source/github-helpers/github-url.ts
parent31aa923b562f3436ec4dc4d2a0e1970a40d20830 (diff)
downloadrefined-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.ts2
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) {