t7510: exit for loop with test result

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>

Michael J Gruber committed Jun 23, 2014 at 09:05 UTC 0f109c92b07eb13ffc675a7e98e9cfc3fee42994
1 file changed +2 -2
t/t7510-signed-commit.sh
+2 -2
@@ -50,7 +50,7 @@ test_expect_success GPG 'show signatures' '
50 for commit in initial second merge fourth-signed fifth-signed sixth-signed master
51 do
52 git show --pretty=short --show-signature $commit >actual &&
53 - grep "Good signature from" actual || exit 1
53 + grep "Good signature from" actual &&
54 ! grep "BAD signature from" actual || exit 1
55 echo $commit OK
56 done
@@ -59,7 +59,7 @@ test_expect_success GPG 'show signatures' '
59 for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned
60 do
61 git show --pretty=short --show-signature $commit >actual &&
62 - grep "Good signature from" actual && exit 1
62 + ! grep "Good signature from" actual &&
63 ! grep "BAD signature from" actual || exit 1
64 echo $commit OK
65 done