summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-03-25 05:29:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-25 17:24:13 (GMT)
commit76e057dba29af1f322a19cb75b2921010dbe459c (patch)
tree366fda4723074b4707c7ffa77a1b90c72edcc261 /t
parent6636cf7e907d889eb69fe645198e58c773b2f755 (diff)
downloadgit-76e057dba29af1f322a19cb75b2921010dbe459c.zip
git-76e057dba29af1f322a19cb75b2921010dbe459c.tar.gz
git-76e057dba29af1f322a19cb75b2921010dbe459c.tar.bz2
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t7701-repack-unpack-unreachable.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index aad8a9c..b66e383 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
}