summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-11-07 02:59:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-11-07 04:31:28 (GMT)
commita3ed7552d6c800b476a3bdfec5fa575295ea4bdf (patch)
treef3b51e63091c0ed06c6cc9709a2b7bd0b307ce14 /builtin/fsck.c
parentee6dfb2d83ba1b057943e705f707fa27e34e47f9 (diff)
downloadgit-a3ed7552d6c800b476a3bdfec5fa575295ea4bdf.zip
git-a3ed7552d6c800b476a3bdfec5fa575295ea4bdf.tar.gz
git-a3ed7552d6c800b476a3bdfec5fa575295ea4bdf.tar.bz2
fsck: return error code when verify_pack() goes wrong
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index df1a88b..4ead98d 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -29,6 +29,7 @@ static int write_lost_and_found;
static int verbose;
#define ERROR_OBJECT 01
#define ERROR_REACHABLE 02
+#define ERROR_PACK 04
#ifdef NO_D_INO_IN_DIRENT
#define SORT_DIRENT 0
@@ -626,7 +627,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
prepare_packed_git();
for (p = packed_git; p; p = p->next)
/* verify gives error messages itself */
- verify_pack(p);
+ if (verify_pack(p))
+ errors_found |= ERROR_PACK;
for (p = packed_git; p; p = p->next) {
uint32_t j, num;