cherry-pick: detect bogus arguments to --mainline
[gitweb.git] / pack-check.c
index d123846ea2be7c34360049864aeb3a88f505dfd1..c5c7763323156232748314723e39deb92b93fa4e 100644 (file)
@@ -57,11 +57,8 @@ static int verify_packfile(struct packed_git *p,
        int err = 0;
        struct idx_entry *entries;
 
-       /* Note that the pack header checks are actually performed by
-        * use_pack when it first opens the pack file.  If anything
-        * goes wrong during those checks then the call will die out
-        * immediately.
-        */
+       if (!is_pack_valid(p))
+               return error("packfile %s cannot be accessed", p->pack_name);
 
        git_SHA1_Init(&ctx);
        do {