Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 3fa1025

Browse files
chriscoolgitster
authored andcommitted
replace: add test for --graft with a mergetag
Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 25a05a8 commit 3fa1025

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

t/t6050-replace.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,26 @@ test_expect_success GPG '--graft with a signed commit' '
418418
git replace -d $HASH8
419419
'
420420

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+
421443
test_done

0 commit comments

Comments
 (0)