Commit e989bb2b authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

Make git-nav-upstream use the upstream branch name

The previous git-nav-upstream fix used the current branch name, and
stored the upstream move relative to that branch (in the reflog), e.g
nav-upstream from branch foo to origin/master would should foo@{u}.
This unfortunately breaks if the branch is then deleted, so now we
calculate the upstream branch before checking it out, by passing
"@{u}" rather than HEAD to rev-parse.

Change-Id: I14a2eb8493d63e8386e988fd68b8a3125f19ce2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1536070
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
parent 51c0f388
......@@ -3,4 +3,4 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
git checkout "$(git rev-parse --abbrev-ref HEAD)@{u}"
git checkout "$(git rev-parse --abbrev-ref "@{u}")"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment