summaryrefslogtreecommitdiff
path: root/t/t5514-fetch-multiple.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-03-25 01:29:52 -0400
committerJunio C Hamano <gitster@pobox.com>2015-03-25 10:25:27 -0700
commite6821d09e4655af94f9c8af07333ae710094996a (patch)
treef8c82901ba5cff198cd624354a06b907d88ebcf0 /t/t5514-fetch-multiple.sh
parent76e057dba29af1f322a19cb75b2921010dbe459c (diff)
downloadgit-e6821d09e4655af94f9c8af07333ae710094996a.tar.gz
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/t5514-fetch-multiple.sh')
-rwxr-xr-xt/t5514-fetch-multiple.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh
index 0f8140957f..4b4b6673b8 100755
--- a/t/t5514-fetch-multiple.sh
+++ b/t/t5514-fetch-multiple.sh
@@ -120,7 +120,7 @@ test_expect_success 'git fetch --all (skipFetchAll)' '
(cd test4 &&
for b in $(git branch -r)
do
- git branch -r -d $b || break
+ git branch -r -d $b || exit 1
done &&
git remote add three ../three &&
git config remote.three.skipFetchAll true &&
@@ -144,7 +144,7 @@ test_expect_success 'git fetch --multiple (ignoring skipFetchAll)' '
(cd test4 &&
for b in $(git branch -r)
do
- git branch -r -d $b || break
+ git branch -r -d $b || exit 1
done &&
git fetch --multiple one two three &&
git branch -r > output &&