summaryrefslogtreecommitdiff
path: root/pack-revindex.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2008-10-29 19:02:49 -0400
committerJunio C Hamano <gitster@pobox.com>2008-11-02 15:22:35 -0800
commit08698b1e32bc414f214b7300b40c30a30d9ecd1c (patch)
tree1fc01119e8590049d0f5e5949b4b6a9d83db75eb /pack-revindex.c
parent03d660150cbc80cd7d2ec90c3c4e6ce563295e3a (diff)
downloadgit-08698b1e32bc414f214b7300b40c30a30d9ecd1c.tar.gz
make find_pack_revindex() aware of the nasty world
It currently calls die() whenever given offset is not found thinking that such thing should never happen. But this offset may come from a corrupted pack whych _could_ happen and not be found. Callers should deal with this possibility gracefully instead. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-revindex.c')
-rw-r--r--pack-revindex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pack-revindex.c b/pack-revindex.c
index 6096b6224a..1de53c8934 100644
--- a/pack-revindex.c
+++ b/pack-revindex.c
@@ -140,7 +140,8 @@ struct revindex_entry *find_pack_revindex(struct packed_git *p, off_t ofs)
else
lo = mi + 1;
} while (lo < hi);
- die("internal error: pack revindex corrupt");
+ error("bad offset for revindex");
+ return NULL;
}
void discard_revindex(void)