From 4dd9e189c807e028a6c110b694251db02aa76d30 Mon Sep 17 00:00:00 2001 From: yakov116 <16872793+yakov116@users.noreply.github.com> Date: Mon, 10 Aug 2020 06:20:50 -0400 Subject: Preserve current branch in `forked-to` link when possible (#3420) Co-authored-by: Federico --- source/github-helpers/github-url.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/github-helpers/github-url.ts') 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) { -- cgit v1.2.3