Skip to content

Commit 76e057d

Browse files
peffgitster
authored andcommitted
t7701: fix ignored exit code inside loop
When checking a list of file mtimes, we use a loop and break out early from the loop if any entry does not match. However, the exit code of a loop exited via break is always 0, meaning that the test will fail to notice we had a mismatch. Since the loop is inside a function, we can fix this by doing an early "return 1". Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6636cf7 commit 76e057d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t7701-repack-unpack-unreachable.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ compare_mtimes ()
5757
{
5858
read tref rest &&
5959
while read t rest; do
60-
test "$tref" = "$t" || break
60+
test "$tref" = "$t" || return 1
6161
done
6262
}
6363

0 commit comments

Comments
 (0)