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>
This commit is contained in:
Jeff King
2014-08-29 16:31:46 -04:00
committed by Junio C Hamano
parent d31f3ad23d
commit 2e770fe47e
3 changed files with 29 additions and 8 deletions

View File

@ -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;