Skip to content

Commit 4d8b1dc

Browse files
glandiumgitster
authored andcommitted
Add tests for git tag
These tests check whether git-tag properly sends a comment into the editor, and whether it reuses previous annotation when overwriting an existing tag. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent bab8118 commit 4d8b1dc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t7004-tag.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,4 +1004,20 @@ test_expect_failure \
10041004
'verify signed tag fails when public key is not present' \
10051005
'git-tag -v signed-tag'
10061006

1007+
test_expect_success \
1008+
'message in editor has initial comment' '
1009+
GIT_EDITOR=cat git tag -a initial-comment > actual || true &&
1010+
test $(sed -n "/^\(#\|\$\)/p" actual | wc -l) -gt 0
1011+
'
1012+
1013+
get_tag_header reuse $commit commit $time >expect
1014+
echo "An annotation to be reused" >> expect
1015+
test_expect_success \
1016+
'overwriting an annoted tag should use its previous body' '
1017+
git tag -a -m "An annotation to be reused" reuse &&
1018+
GIT_EDITOR=true git tag -f -a reuse &&
1019+
get_tag_msg reuse >actual &&
1020+
git diff expect actual
1021+
'
1022+
10071023
test_done

0 commit comments

Comments
 (0)