Skip to content

Commit 74060d4

Browse files
committed
t9200: make test "set -e" clean
In order to catch mistakes like misspelling "test_expect_success", we would like to eventually be able to run our test suite with the "-e" option on. This test uses the usual pattern, where it cmd ... if test $? ... expects cmd to be allowed to fail freely and we can act on its exit status, which is not possible under "set -e". Rewrite it using the common pattern: status=0; cmd ... || status=$? if test $status ... which means the same thing but does not fail under "set -e". Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 946684d commit 74060d4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

t/t9200-git-cvsexportcommit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ if ! test_have_prereq PERL; then
1111
test_done
1212
fi
1313

14-
cvs >/dev/null 2>&1
15-
if test $? -ne 1
14+
status=0; cvs >/dev/null 2>&1 || status=$?
15+
if test $status -ne 1
1616
then
1717
skip_all='skipping git cvsexportcommit tests, cvs not found'
1818
test_done

0 commit comments

Comments
 (0)