summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f10c41)
raw | patch | inline | side by side (parent: 6f10c41)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sun, 14 Nov 2010 14:44:15 +0000 (14:44 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 14 Nov 2010 18:43:57 +0000 (10:43 -0800) |
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 <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7004-tag.sh | patch | blob | history |
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index ac943f5eeecd17dd1edc5834265df9e16e5032f2..700b556fe886ff8e6927591e4a047542bc00ef83 100755 (executable)
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
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 <actual) &&
- test -z "$first" &&
+ echo >first.expect &&
+ sed -e 1q <actual >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' <actual) &&
- test -z "$rest"
+ >rest.expect
+ sed -e 1d -e '/^#/d' <actual >rest.actual &&
+ test_cmp rest.expect rest.actual
'
get_tag_header reuse $commit commit $time >expect