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>
This commit is contained in:
Jeff King 2011-10-14 14:04:16 -04:00 коммит произвёл Junio C Hamano
Родитель 4c08018204
Коммит 58a6a9cc43
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;