From 76e057dba29af1f322a19cb75b2921010dbe459c Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 25 Mar 2015 01:29:10 -0400 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- t/t7701-repack-unpack-unreachable.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh index aad8a9c64d..b66e383866 100755 --- a/t/t7701-repack-unpack-unreachable.sh +++ b/t/t7701-repack-unpack-unreachable.sh @@ -57,7 +57,7 @@ compare_mtimes () { read tref rest && while read t rest; do - test "$tref" = "$t" || break + test "$tref" = "$t" || return 1 done }