1
0
mirror of https://github.com/git/git synced 2024-07-05 00:58:49 +00:00

fsck-objects: do not segfault on missing tree in cache-tree

Even if trees are missing in cache-tree, we should continue and
check the rest of the object database.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-05-03 21:17:45 -07:00
parent 00703e6d68
commit 6d60bbefdc

View File

@ -446,6 +446,11 @@ static int fsck_cache_tree(struct cache_tree *it)
if (0 <= it->entry_count) {
struct object *obj = parse_object(it->sha1);
if (!obj) {
error("%s: invalid sha1 pointer in cache-tree",
sha1_to_hex(it->sha1));
return 1;
}
mark_reachable(obj, REACHABLE);
obj->used = 1;
if (obj->type != tree_type)