File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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` ) ;
You can’t perform that action at this time.
0 commit comments