Code

downgrade "packfile cannot be accessed" errors to warnings
authorJeff King <peff@peff.net>
Fri, 14 Oct 2011 18:04:16 +0000 (14:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Oct 2011 18:43:09 +0000 (11:43 -0700)
These can happen if another process simultaneously prunes a
pack. But that is not usually an error condition, because a
properly-running prune should have repacked the object into
a new pack. So we will notice that the pack has disappeared
unexpectedly, print a message, try other packs (possibly
after re-scanning the list of packs), and find it in the new
pack.

Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
sha1_file.c

index fd40410837b50a79063d2f524246f627629dca55..c31bcd01e8e220e3c60dac7f3d756395ff7823a6 100644 (file)
@@ -805,7 +805,7 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
                if (offset) {
                        if (!found_pack) {
                                if (!is_pack_valid(p)) {
-                                       error("packfile %s cannot be accessed", p->pack_name);
+                                       warning("packfile %s cannot be accessed", p->pack_name);
                                        continue;
                                }
                                found_offset = offset;
index 133aa4fe701b9e091079fbe86be05ab71c54cbdc..cad1f22002d87c3bb015917c3f8d3292c1451639 100644 (file)
@@ -2035,7 +2035,7 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
                         * was loaded!
                         */
                        if (!is_pack_valid(p)) {
-                               error("packfile %s cannot be accessed", p->pack_name);
+                               warning("packfile %s cannot be accessed", p->pack_name);
                                goto next;
                        }
                        e->offset = offset;