Skip to content
  • Jeff King's avatar
    t: fix some trivial cases of ignored exit codes in loops · e6821d09
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    e6821d09