Skip to content

Commit 0f109c9

Browse files
Michael J Grubergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d07b00b commit 0f109c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t7510-signed-commit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ test_expect_success GPG 'show signatures' '
5050
for commit in initial second merge fourth-signed fifth-signed sixth-signed master
5151
do
5252
git show --pretty=short --show-signature $commit >actual &&
53-
grep "Good signature from" actual || exit 1
53+
grep "Good signature from" actual &&
5454
! grep "BAD signature from" actual || exit 1
5555
echo $commit OK
5656
done
@@ -59,7 +59,7 @@ test_expect_success GPG 'show signatures' '
5959
for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned
6060
do
6161
git show --pretty=short --show-signature $commit >actual &&
62-
grep "Good signature from" actual && exit 1
62+
! grep "Good signature from" actual &&
6363
! grep "BAD signature from" actual || exit 1
6464
echo $commit OK
6565
done

0 commit comments

Comments
 (0)