aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-10-14 14:04:16 -0400
committerJunio C Hamano <gitster@pobox.com>2011-10-14 11:43:09 -0700
commit58a6a9cc4397477a7d8b620165e651028cc0e3c9 (patch)
tree79ecdaf8e79365abee1b8ea2342b656ba7a5aafc
parent4c08018204f95c492c0ad7b033b8f57ccc2e43f5 (diff)
downloadgit-58a6a9cc4397477a7d8b620165e651028cc0e3c9.tar.gz
git-58a6a9cc4397477a7d8b620165e651028cc0e3c9.tar.xz
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>
-rw-r--r--builtin/pack-objects.c2
-rw-r--r--sha1_file.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index fd4041083..c31bcd01e 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -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;
diff --git a/sha1_file.c b/sha1_file.c
index 133aa4fe7..cad1f2200 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -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;