diff options
author | Jeff King <peff@peff.net> | 2015-03-25 01:28:44 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-25 10:22:35 -0700 |
commit | fd7771415b9447c8e53dd99d7946e00ee212d70d (patch) | |
tree | bd28b05203f7bdfa956b0388c644162567271d8a /t/t3303-notes-subtrees.sh | |
parent | perf-lib: fix ignored exit code inside loop (diff) | |
download | tgif-fd7771415b9447c8e53dd99d7946e00ee212d70d.tar.xz |
t0020: fix ignored exit code inside loops
A loop like:
for f in one two; do
something $f ||
break
done
will correctly break out of the loop when we see a failure
of one item, but the resulting exit code will always be
zero. We can fix that by putting the loop into a function or
subshell, but in this case it is simpler still to just
unroll the loop. We do add a helper function, which
hopefully makes the end result even more readable (in
addition to being shorter).
Reported-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3303-notes-subtrees.sh')
0 files changed, 0 insertions, 0 deletions