aboutsummaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-08-17 01:52:48 -0500
committerJunio C Hamano <gitster@pobox.com>2010-08-18 14:02:02 -0700
commitb81f925f709a10b37fb4fcd03629b55bc890a478 (patch)
tree915874e3e43dc2615104b2fceca2ea5ecfffa1e5 /t/t7600-merge.sh
parent64fdc08dac6694d1e754580e7acb82dfa4988bb9 (diff)
downloadgit-b81f925f709a10b37fb4fcd03629b55bc890a478.tar.gz
git-b81f925f709a10b37fb4fcd03629b55bc890a478.tar.xz
merge: do not mistake (ancestor of) tag for branch
If no branch 'foo' exists but a tag 'foo' does, then git merge foo^ results in Merge branch 'foo' (early part) as a commit message, because the relevant code path checks that refs/heads/foo is a valid refname for writing rather than for reading. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index cde8390c1..16e5ba1d8 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -558,8 +558,11 @@ test_expect_success 'refresh the index before merging' '
git merge c3
'
-cat >expected <<EOF
-Merge branch 'c5' (early part)
+cat >expected.branch <<\EOF
+Merge branch 'c5-branch' (early part)
+EOF
+cat >expected.tag <<\EOF
+Merge commit 'c5~1'
EOF
test_expect_success 'merge early part of c2' '
@@ -577,9 +580,14 @@ test_expect_success 'merge early part of c2' '
git add c6.c &&
git commit -m c6 &&
git tag c6 &&
+ git branch -f c5-branch c5 &&
+ git merge c5-branch~1 &&
+ git show -s --pretty=format:%s HEAD >actual.branch &&
+ git reset --keep HEAD^ &&
git merge c5~1 &&
- git show -s --pretty=format:%s HEAD > actual &&
- test_cmp actual expected
+ git show -s --pretty=format:%s HEAD >actual.tag &&
+ test_cmp expected.branch actual.branch &&
+ test_cmp expected.tag actual.tag
'
test_debug 'gitk --all'