mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6636cf7e90
commit
76e057dba2
|
@ -57,7 +57,7 @@ compare_mtimes ()
|
||||||
{
|
{
|
||||||
read tref rest &&
|
read tref rest &&
|
||||||
while read t rest; do
|
while read t rest; do
|
||||||
test "$tref" = "$t" || break
|
test "$tref" = "$t" || return 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue