From 5649bd9a5174c5dbd1933b26275f7c7f50fd9224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 14 Nov 2010 14:44:15 +0000 Subject: t7004-tag.sh: re-arrange git tag comment for clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t7004-tag.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index ac943f5ee..700b556fe 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1051,13 +1051,23 @@ test_expect_success \ test_expect_success \ 'message in editor has initial comment' ' - GIT_EDITOR=cat git tag -a initial-comment > actual + ! (GIT_EDITOR=cat git tag -a initial-comment > actual) +' + +test_expect_success \ + 'message in editor has initial comment: first line' ' # check the first line --- should be empty - first=$(sed -e 1q first.expect && + sed -e 1q first.actual && + test_cmp first.expect first.actual +' + +test_expect_success \ + 'message in editor has initial comment: remainder' ' # remove commented lines from the remainder -- should be empty - rest=$(sed -e 1d -e '/^#/d' rest.expect + sed -e 1d -e '/^#/d' rest.actual && + test_cmp rest.expect rest.actual ' get_tag_header reuse $commit commit $time >expect -- cgit v1.2.1