diff options
author | Jeff King <peff@peff.net> | 2015-03-25 08:29:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-25 20:25:27 +0300 |
commit | e6821d09e4655af94f9c8af07333ae710094996a (patch) | |
tree | f8c82901ba5cff198cd624354a06b907d88ebcf0 /t/t6026-merge-attr.sh | |
parent | 76e057dba29af1f322a19cb75b2921010dbe459c (diff) |
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6026-merge-attr.sh')
-rwxr-xr-x | t/t6026-merge-attr.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh index 5e439972be..3c21938a68 100755 --- a/t/t6026-merge-attr.sh +++ b/t/t6026-merge-attr.sh @@ -11,7 +11,7 @@ test_expect_success setup ' for f in text binary union do - echo Initial >$f && git add $f || break + echo Initial >$f && git add $f || return 1 done && test_tick && git commit -m Initial && @@ -19,7 +19,7 @@ test_expect_success setup ' git branch side && for f in text binary union do - echo Master >>$f && git add $f || break + echo Master >>$f && git add $f || return 1 done && test_tick && git commit -m Master && @@ -27,7 +27,7 @@ test_expect_success setup ' git checkout side && for f in text binary union do - echo Side >>$f && git add $f || break + echo Side >>$f && git add $f || return 1 done && test_tick && git commit -m Side && |