summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2011-08-19 11:45:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-19 18:01:36 (GMT)
commite9d4f7405b6ab399ef0ea62a796c646de676555d (patch)
tree309ae2ed0ff47ef9baa51d58f7721457888f462f /t
parentec099546a9afdb73b6bf39d5d684e6fb207e2a7f (diff)
downloadgit-e9d4f7405b6ab399ef0ea62a796c646de676555d.zip
git-e9d4f7405b6ab399ef0ea62a796c646de676555d.tar.gz
git-e9d4f7405b6ab399ef0ea62a796c646de676555d.tar.bz2
branch.c: use the parsed branch name
When setting up tracking info, branch.c uses the given branch specifier ("name"). Use the parsed name ("ref.buf") instead so that git branch --set-upstream @{-1} foo sets up tracking info for the previous branch rather than for a branch named "@{-1}". Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6040-tracking-info.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index a9b0ac1..19de5b1 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -110,4 +110,18 @@ test_expect_success '--set-upstream does not change branch' '
grep -q "^refs/heads/master$" actual &&
cmp expect2 actual2
'
+
+test_expect_success '--set-upstream @{-1}' '
+ git checkout from-master &&
+ git checkout from-master2 &&
+ git config branch.from-master2.merge > expect2 &&
+ git branch --set-upstream @{-1} follower &&
+ git config branch.from-master.merge > actual &&
+ git config branch.from-master2.merge > actual2 &&
+ git branch --set-upstream from-master follower &&
+ git config branch.from-master.merge > expect &&
+ test_cmp expect2 actual2 &&
+ test_cmp expect actual
+'
+
test_done