summaryrefslogtreecommitdiff
path: root/source/github-helpers/github-url.ts
diff options
context:
space:
mode:
Diffstat (limited to 'source/github-helpers/github-url.ts')
-rw-r--r--source/github-helpers/github-url.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/github-helpers/github-url.ts b/source/github-helpers/github-url.ts
index 8c5b1258..f9355e32 100644
--- a/source/github-helpers/github-url.ts
+++ b/source/github-helpers/github-url.ts
@@ -73,6 +73,13 @@ export default class GitHubURL {
set pathname(pathname: string) {
const [user, repository, route, ...ambiguousReference] = pathname.replace(/^\/|\/$/g, '').split('/');
+ // Handle branch names containing multiple slashes #4492
+ if (ambiguousReference.length === 2 && ambiguousReference[1].includes('%2F')) {
+ const branch = ambiguousReference.join('/').replace(/%2F/g, '/');
+ this.assign({user, repository, route, branch, filePath: ''});
+ return;
+ }
+
const {branch, filePath} = this.disambiguateReference(ambiguousReference);
this.assign({user, repository, route, branch, filePath});
}