提交 76e057db 编写于 作者: J Jeff King 提交者: Junio C Hamano

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: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 6636cf7e
......@@ -57,7 +57,7 @@ compare_mtimes ()
{
read tref rest &&
while read t rest; do
test "$tref" = "$t" || break
test "$tref" = "$t" || return 1
done
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册