diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-21 16:04:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-21 16:04:33 -0700 |
commit | 207095063379065f2894c091c8909269a00ed44a (patch) | |
tree | 0e117b5b75a459622282fd65510b54978a2d2458 /builtin/pack-objects.c | |
parent | e75a59adfcc4fd048690e5b25f9a8c31d8011d53 (diff) | |
parent | 58a6a9cc4397477a7d8b620165e651028cc0e3c9 (diff) | |
download | git-207095063379065f2894c091c8909269a00ed44a.tar.gz |
Merge branch 'jk/maint-pack-objects-compete-with-delete'
* jk/maint-pack-objects-compete-with-delete:
downgrade "packfile cannot be accessed" errors to warnings
pack-objects: protect against disappearing packs
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r-- | builtin/pack-objects.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 2b18de5dc3..ba3705d1de 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -804,6 +804,10 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type, off_t offset = find_pack_entry_one(sha1, p); if (offset) { if (!found_pack) { + if (!is_pack_valid(p)) { + warning("packfile %s cannot be accessed", p->pack_name); + continue; + } found_offset = offset; found_pack = p; } |