summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2014-07-19 15:01:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-21 19:07:04 (GMT)
commit3fa102590758594e3df45c58caba945894a608e5 (patch)
tree05368bcd0b8beaa0baa3d7a4371b9b20b9e62a57
parent25a05a8cae263ca55e75d31336d09c8d9bc90be3 (diff)
downloadgit-3fa102590758594e3df45c58caba945894a608e5.zip
git-3fa102590758594e3df45c58caba945894a608e5.tar.gz
git-3fa102590758594e3df45c58caba945894a608e5.tar.bz2
replace: add test for --graft with a mergetag
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t6050-replace.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index cebab63..4d5a25e 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -418,4 +418,26 @@ test_expect_success GPG '--graft with a signed commit' '
git replace -d $HASH8
'
+test_expect_success GPG 'set up a merge commit with a mergetag' '
+ git reset --hard HEAD &&
+ git checkout -b test_branch HEAD~2 &&
+ echo "line 1 from test branch" >>hello &&
+ echo "line 2 from test branch" >>hello &&
+ git add hello &&
+ test_tick &&
+ git commit -m "hello: 2 more lines from a test branch" &&
+ HASH9=$(git rev-parse --verify HEAD) &&
+ git tag -s -m "tag for testing with a mergetag" test_tag HEAD &&
+ git checkout master &&
+ git merge -s ours test_tag &&
+ HASH10=$(git rev-parse --verify HEAD) &&
+ git cat-file commit $HASH10 | grep "^mergetag object"
+'
+
+test_expect_success GPG '--graft on a commit with a mergetag' '
+ test_must_fail git replace --graft $HASH10 $HASH8^1 &&
+ git replace --graft $HASH10 $HASH8^1 $HASH9 &&
+ git replace -d $HASH10
+'
+
test_done