From e6821d09e4655af94f9c8af07333ae710094996a Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 25 Mar 2015 01:29:52 -0400 Subject: t: fix some trivial cases of ignored exit codes in loops These are all cases where we do a setup step of the form: for i in $foo; do set_up $i || break done && more_setup would not notice a failure in set_up (because break always returns a 0 exit code). These are just setup steps that we do not expect to fail, but it does not hurt to be defensive. Most can be fixed by converting the "break" to a "return 1" (since we eval our tests inside a function for just this purpose). A few of the loops are inside subshells, so we can use just "exit 1" to break out of the subshell. And a few can actually be made shorter by just unrolling the loop. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t4151-am-abort.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t4151-am-abort.sh') diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh index 1176bcccf3..8d90634ab8 100755 --- a/t/t4151-am-abort.sh +++ b/t/t4151-am-abort.sh @@ -20,7 +20,7 @@ test_expect_success setup ' echo $i >otherfile-$i && git add otherfile-$i && test_tick && - git commit -a -m $i || break + git commit -a -m $i || return 1 done && git format-patch --no-numbered initial && git checkout -b side initial && -- cgit v1.2.3