Skip to content

Commit

Permalink
downgrade "packfile cannot be accessed" errors to warnings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Oct 14, 2011
1 parent 4c08018 commit 58a6a9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58a6a9c

Please sign in to comment.