Skip to content

Commit

Permalink
replace: add test for --graft with a mergetag
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Jul 21, 2014
1 parent 25a05a8 commit 3fa1025
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions t/t6050-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3fa1025

Please sign in to comment.