Merge pull request #4493 from gitbutlerapp/encode-branch-names

Encode branch names
This commit is contained in:
Caleb Owens 2024-07-25 16:28:44 +02:00 committed by GitHub
commit 008a411ebf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,7 @@
// Here we specifically want to prefer looking at the remote branch as
// the there may be multiple remotes that share the same local branch.
if (b.branch)
return `/${projectId}/branch/${branch?.remoteBranch?.name || branch?.localBranch?.name}`;
return `/${projectId}/branch/${encodeURIComponent(branch?.remoteBranch?.name || branch!.localBranch!.name)}`;
if (b.pr) return `/${projectId}/pull/${b.pr.number}`;
}