File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+
421443test_done
You can’t perform that action at this time.
0 commit comments