]> git.ipfire.org Git - thirdparty/git.git/commit
t1020: avoid aborting entire test script when one test fails
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 9 Dec 2021 05:10:59 +0000 (00:10 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Dec 2021 18:29:48 +0000 (10:29 -0800)
commitfe13adb17b7fcf0560139bb279d6d1274c84bec9
tree2c91933832c875f5c9be7ea37f78b8851bb98a7c
parentafb31ad95f035e5abff7c8a6b4a12195f41e857a
t1020: avoid aborting entire test script when one test fails

Although `exit 1` is the proper way to signal a test failure from within
a subshell, its use outside any subshell should be avoided since it
aborts the entire script rather than aborting only the failed test.
Instead, a simple `return 1` is the proper idiom for signaling failure
outside a subshell since it aborts only the test in question, not the
entire script.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1020-subdirectory.sh