-
Leszek Swirski authored
Using just @{u} to navigate upstream breaks navigating back down when the upstream reaches a non-local branch, e.g. origin/master. This is because git branch walks the reflog for detached heads, and sees @{u} instead of e.g. origin/master, and so tries to calculate HEAD@{u} which fails. See also the message send to the git mailing list: https://public-inbox.org/git/CAGRskv__Qe-F-grBtq5v-uhHE+BQAcAcOQtX-GKB+MNOrxs0hQ@mail.gmail.com/ This patch works around this by manually specifying the branch from which we are calculating upstream, e.g. for branch foo we do git checkout foo@{u} instead of just git checkout @{u}. This ensures that the reflog has a valid entry (albeit still a relative one). Change-Id: I339d4e4288a1e104b9d7d3d568c45b2b156f0689 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1534217Reviewed-by: Robbie Iannucci <iannucci@chromium.org> Commit-Queue: Robbie Iannucci <iannucci@chromium.org> Auto-Submit: Leszek Swirski <leszeks@chromium.org>
33bd5822