Skip to content

Commit 59b5444

Browse files
committed
Revert prefering local branch name
1 parent 376eb77 commit 59b5444

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/view/reviewManager.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,7 @@ export class ReviewManager extends Disposable {
428428
private async getUpstreamUrlAndName(branch: Branch): Promise<{ remoteUrl: string | undefined, upstreamBranchName: string | undefined, remoteName: string | undefined }> {
429429
if (branch.upstream) {
430430
Logger.debug(`Upstream for branch ${branch.name} is ${branch.upstream.remote}/${branch.upstream.name}`, this.id);
431-
// When a branch is created tracking a different remote branch (e.g. via
432-
// `git worktree add -b feature-foo <path> origin/develop`), git sets
433-
// `branch.<name>.merge` to the upstream's branch (`develop`) even though
434-
// the eventual PR head ref is the local branch name (`feature-foo`).
435-
// Prefer the local branch name when it differs from the tracked upstream,
436-
// since GitHub PR `headRefName` matches the pushed branch name, which
437-
// defaults to the local branch name.
438-
const upstreamBranchName = (branch.name && branch.upstream.name !== branch.name)
439-
? branch.name
440-
: branch.upstream.name;
441-
return { remoteName: branch.upstream.remote, upstreamBranchName, remoteUrl: undefined };
431+
return { remoteName: branch.upstream.remote, upstreamBranchName: branch.upstream.name, remoteUrl: undefined };
442432
} else {
443433
try {
444434
const remoteUrl = await this.repository.getConfig(`branch.${branch.name}.remote`);

0 commit comments

Comments
 (0)