summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-08-29 20:31:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-09-10 16:40:53 (GMT)
commit2e770fe47ef9c0b20bc687e37f3eb50f1bf919d0 (patch)
tree002f9ee6fb1a4262c9940e37830669da6fed9d70 /builtin
parentd31f3ad23dd1aee3c3e1015a43b02b995c01a9a1 (diff)
downloadgit-2e770fe47ef9c0b20bc687e37f3eb50f1bf919d0.zip
git-2e770fe47ef9c0b20bc687e37f3eb50f1bf919d0.tar.gz
git-2e770fe47ef9c0b20bc687e37f3eb50f1bf919d0.tar.bz2
fsck: exit with non-zero status upon error from fsck_obj()
Upon finding a corrupt loose object, we forgot to note the error to signal it with the exit status of the entire process. [jc: adjusted t1450 and added another test] Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fsck.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 1affdd5..8abe644 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -389,7 +389,8 @@ static void fsck_sha1_list(void)
unsigned char *sha1 = entry->sha1;
sha1_list.entry[i] = NULL;
- fsck_sha1(sha1);
+ if (fsck_sha1(sha1))
+ errors_found |= ERROR_OBJECT;
free(entry);
}
sha1_list.nr = 0;