downgrade "packfile cannot be accessed" errors to warnings
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>
Jeff King committed
Oct 14, 2011 at 14:04 UTC
58a6a9cc4397477a7d8b620165e651028cc0e3c9
2 files changed
+2
-2
builtin/pack-objects.c
+1
-1
@@ -805,7 +805,7 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
805
if (offset) {
806
if (!found_pack) {
807
if (!is_pack_valid(p)) {
808
- error("packfile %s cannot be accessed", p->pack_name);
808
+ warning("packfile %s cannot be accessed", p->pack_name);
809
continue;
810
}
811
found_offset = offset;
sha1_file.c
+1
-1
@@ -2035,7 +2035,7 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
2035
* was loaded!
2036
*/
2037
if (!is_pack_valid(p)) {
2038
- error("packfile %s cannot be accessed", p->pack_name);
2038
+ warning("packfile %s cannot be accessed", p->pack_name);
2039
goto next;
2040
}
2041
e->offset = offset;