t: fix some trivial cases of ignored exit codes in loops
commite6821d09e4655af94f9c8af07333ae710094996a
authorJeff King <peff@peff.net>
Wed, 25 Mar 2015 05:29:52 +0000 (25 01:29 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Mar 2015 17:25:27 +0000 (25 10:25 -0700)
treef8c82901ba5cff198cd624354a06b907d88ebcf0
parent76e057dba29af1f322a19cb75b2921010dbe459c
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>
t/t3010-ls-files-killed-modified.sh
t/t3031-merge-criscross.sh
t/t3202-show-branch-octopus.sh
t/t4024-diff-optimize-common.sh
t/t4046-diff-unmerged.sh
t/t4151-am-abort.sh
t/t5505-remote.sh
t/t5514-fetch-multiple.sh
t/t6026-merge-attr.sh
t/t6040-tracking-info.sh