sourcegraph-vscode-DEPRECATED icon indicating copy to clipboard operation
sourcegraph-vscode-DEPRECATED copied to clipboard

Fix: Fallback to upstream branch name when remote does not match branch

Open casassg opened this issue 4 years ago • 1 comments

Followup from testing https://github.com/sourcegraph/sourcegraph-vscode/pull/162.

Normally when there's a mismatch between upstreamAndBranch and branch it's better to use the branch name in upstreamAndBranch. When using branch, it may be that branch is not existing in remote and therefore not accessible by SourceGraph (it returns 500 when that's the case). In that sense, it's better to fallback to the branch name included in upstreamAndBranch as that usually points to a branch that does exist upstream.

casassg avatar Apr 05 '21 22:04 casassg

I realized shortly after the extension updated that I ran into the same issue as @casassg in cases where I haven't pushed my branch to upstream (in my testing I did it with a branch that was pushed, but where upstream returned origin/master, hence the confusion). Thanks for fixing it - looks good to me.

alexschneider avatar Apr 05 '21 22:04 alexschneider