summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-10-14 14:42:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-10-14 15:12:07 -0700
commit05e73682cd28eeaf6d949badefd85b94244fca3f (patch)
tree5ef371b5848c10f55af962ef2080c767711e3729 /t/t4202-log.sh
parentMerge branch 'maint-1.9' into maint-2.0 (diff)
downloadtgif-05e73682cd28eeaf6d949badefd85b94244fca3f.tar.xz
checkout: report upstream correctly even with loosely defined branch.*.merge
When checking out a branch that is set to build on top of another branch (often, a remote-tracking branch), "git checkout" reports how your work relates to the other branch, e.g. Your branch is behind 'origin/master', and can be fast-forwarded. Back when this feature was introduced, this was only done for branches that build on remote-tracking branches, but 5e6e2b48 (Make local branches behave like remote branches when --tracked, 2009-04-01) added support to give the same report for branches that build on other local branches (i.e. branches whose branch.*.remote variables are set to '.'). Unlike the support for the branches building on remote-tracking branches, however, this did not take into account the fact that branch.*.merge configuration is allowed to record a shortened branch name. When branch.*.merge is set to 'master' (not 'refs/heads/master'), i.e. "my branch builds on the local 'master' branch", this caused "git checkout" to report: Your branch is based on 'master', but the upstream is gone. The upstream is our repository and is definitely not gone, so this output is nonsense. The fix is fairly obvious; just like the branch name is DWIMed when "git pull" merges from the 'master' branch without complaint on such a branch, the name of the branch the current branch builds upon needs to be DWIMed the same way. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4202-log.sh')
0 files changed, 0 insertions, 0 deletions