Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Assumes all upstream branch names will start with 'refs/remotes/', then
- slices out the remote branch name without making any assumptions as to what it's named, and
- joins the rest of the split elements
  • Loading branch information
03juan authored and krlvi committed Feb 15, 2024
1 parent 7ebcd41 commit 2cb9711
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gitbutler-ui/src/lib/vbranches/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ export class BaseBranch {
branchUrl(upstreamBranchName: string | undefined) {
if (!upstreamBranchName) return undefined;
const baseBranchName = this.branchName.split('/')[1];
const parts = upstreamBranchName.split('/');
const branchName = parts[parts.length - 1];
const branchName = upstreamBranchName.split('refs/remotes/')[1].split('/').slice(1).join('/');
return `${this.repoBaseUrl.trim()}/compare/${baseBranchName}...${branchName}`;
}
}

0 comments on commit 2cb9711

Please sign in to comment.