Skip to content

Commit

Permalink
t7510: exit for loop with test result
Browse files Browse the repository at this point in the history
t7510 uses for loops in a subshell, which need to make sure that the test
returns with the appropriate error code from within the loop.

Restructure the loops as the usual && chains with a single point of
"exit 1" at the end of the loop to make this clearer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Jun 23, 2014
1 parent d07b00b commit 0f109c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/t7510-signed-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test_expect_success GPG 'show signatures' '
for commit in initial second merge fourth-signed fifth-signed sixth-signed master
do
git show --pretty=short --show-signature $commit >actual &&
grep "Good signature from" actual || exit 1
grep "Good signature from" actual &&
! grep "BAD signature from" actual || exit 1
echo $commit OK
done
Expand All @@ -59,7 +59,7 @@ test_expect_success GPG 'show signatures' '
for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned
do
git show --pretty=short --show-signature $commit >actual &&
grep "Good signature from" actual && exit 1
! grep "Good signature from" actual &&
! grep "BAD signature from" actual || exit 1
echo $commit OK
done
Expand Down

0 comments on commit 0f109c9

Please sign in to comment.