Skip to content

Commit 5649bd9

Browse files
avargitster
authored andcommitted
t7004-tag.sh: re-arrange git tag comment for clarity
Split the "message in editor has initial comment" test into three tests. The motivation is to be able to only skip the middle part under NO_GETTEXT_POISON. In addition the return value of 'git tag' was being returned. We now check that it's non-zero. I used ! instead of test_must_fail so that the GIT_EDITOR variable was only used in this command invocation, and because the surrounding tests use this style. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6f10c41 commit 5649bd9

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

t/t7004-tag.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,13 +1051,23 @@ test_expect_success \
10511051

10521052
test_expect_success \
10531053
'message in editor has initial comment' '
1054-
GIT_EDITOR=cat git tag -a initial-comment > actual
1054+
! (GIT_EDITOR=cat git tag -a initial-comment > actual)
1055+
'
1056+
1057+
test_expect_success \
1058+
'message in editor has initial comment: first line' '
10551059
# check the first line --- should be empty
1056-
first=$(sed -e 1q <actual) &&
1057-
test -z "$first" &&
1060+
echo >first.expect &&
1061+
sed -e 1q <actual >first.actual &&
1062+
test_cmp first.expect first.actual
1063+
'
1064+
1065+
test_expect_success \
1066+
'message in editor has initial comment: remainder' '
10581067
# remove commented lines from the remainder -- should be empty
1059-
rest=$(sed -e 1d -e '/^#/d' <actual) &&
1060-
test -z "$rest"
1068+
>rest.expect
1069+
sed -e 1d -e '/^#/d' <actual >rest.actual &&
1070+
test_cmp rest.expect rest.actual
10611071
'
10621072
10631073
get_tag_header reuse $commit commit $time >expect

0 commit comments

Comments
 (0)