Code

Merge branch 'jm/maint-gitweb-filter-forks-fix'
[git.git] / builtin / pack-objects.c
index 2b18de5dc37bf849dbdbc892e4e9f3a34893dd9d..ba3705d1de0d91714be4c967a26ffd263e09878c 100644 (file)
@@ -804,6 +804,10 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
                off_t offset = find_pack_entry_one(sha1, p);
                if (offset) {
                        if (!found_pack) {
+                               if (!is_pack_valid(p)) {
+                                       warning("packfile %s cannot be accessed", p->pack_name);
+                                       continue;
+                               }
                                found_offset = offset;
                                found_pack = p;
                        }