diff options
author | 2021-11-03 13:15:11 +0100 | |
---|---|---|
committer | 2021-11-03 13:15:11 +0100 | |
commit | 1fd3bbb39a5e5eea712a7973fac1faa6ff5fef66 (patch) | |
tree | a7e9d97bc950780e5b8f4277908196e7d85da2e9 /source/github-helpers/github-url.ts | |
parent | 9c8e94304862725d0f28958015b078b88c9dcd0d (diff) | |
download | refined-github-1fd3bbb39a5e5eea712a7973fac1faa6ff5fef66.tar.gz refined-github-1fd3bbb39a5e5eea712a7973fac1faa6ff5fef66.tar.zst refined-github-1fd3bbb39a5e5eea712a7973fac1faa6ff5fef66.zip |
Fix: Branches with multiple slashes aren't fully supported (#5026)
Diffstat (limited to 'source/github-helpers/github-url.ts')
-rw-r--r-- | source/github-helpers/github-url.ts | 7 |
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}); } |