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>

Christian Couder committed Jul 19, 2014 at 17:01 UTC 3fa102590758594e3df45c58caba945894a608e5
1 file changed +22
t/t6050-replace.sh
+22
@@ -418,4 +418,26 @@ test_expect_success GPG '--graft with a signed commit' '
418 git replace -d $HASH8
419 '
420
421 +test_expect_success GPG 'set up a merge commit with a mergetag' '
422 + git reset --hard HEAD &&
423 + git checkout -b test_branch HEAD~2 &&
424 + echo "line 1 from test branch" >>hello &&
425 + echo "line 2 from test branch" >>hello &&
426 + git add hello &&
427 + test_tick &&
428 + git commit -m "hello: 2 more lines from a test branch" &&
429 + HASH9=$(git rev-parse --verify HEAD) &&
430 + git tag -s -m "tag for testing with a mergetag" test_tag HEAD &&
431 + git checkout master &&
432 + git merge -s ours test_tag &&
433 + HASH10=$(git rev-parse --verify HEAD) &&
434 + git cat-file commit $HASH10 | grep "^mergetag object"
435 +'
436 +
437 +test_expect_success GPG '--graft on a commit with a mergetag' '
438 + test_must_fail git replace --graft $HASH10 $HASH8^1 &&
439 + git replace --graft $HASH10 $HASH8^1 $HASH9 &&
440 + git replace -d $HASH10
441 +'
442 +
443 test_done