Skip to content

Commit

Permalink
fsck-objects: do not segfault on missing tree in cache-tree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed May 4, 2006
1 parent 00703e6 commit 6d60bbe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fsck-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6d60bbe

Please sign in to comment.