Skip to content

Commit a38d3d7

Browse files
committed
t6200: test message for merging of an annotated tag
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a94dba commit a38d3d7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

t/t6200-fmt-merge-msg.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,4 +469,43 @@ test_expect_success 'merge-msg lots of commits' '
469469
test_cmp expected actual
470470
'
471471

472+
test_expect_success 'merge-msg with "merging" an annotated tag' '
473+
test_config merge.log true &&
474+
475+
git checkout master^0 &&
476+
git commit --allow-empty -m "One step ahead" &&
477+
git tag -a -m "An annotated one" annote HEAD &&
478+
479+
git checkout master &&
480+
git fetch . annote &&
481+
482+
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
483+
{
484+
cat <<-\EOF
485+
Merge tag '\''annote'\''
486+
487+
An annotated one
488+
489+
* tag '\''annote'\'':
490+
One step ahead
491+
EOF
492+
} >expected &&
493+
test_cmp expected actual &&
494+
495+
test_when_finished "git reset --hard" &&
496+
annote=$(git rev-parse annote) &&
497+
git merge --no-commit $annote &&
498+
{
499+
cat <<-EOF
500+
Merge tag '\''$annote'\''
501+
502+
An annotated one
503+
504+
* tag '\''$annote'\'':
505+
One step ahead
506+
EOF
507+
} >expected &&
508+
test_cmp expected .git/MERGE_MSG
509+
'
510+
472511
test_done

0 commit comments

Comments
 (0)