fixup! path-walk API: avoid adding a root tree more than once

Ooops. Must not risk a segmentation fault in a partial clone missing
trees...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2024-10-08 09:13:06 +02:00
parent ed7f388983
commit d53e4648cb

View File

@@ -360,11 +360,11 @@ int walk_objects_by_path(struct path_walk_info *info)
oid = get_commit_tree_oid(c);
t = lookup_tree(info->revs->repo, oid);
if (t->object.flags & SEEN)
continue;
t->object.flags |= SEEN;
if (t) {
if (t->object.flags & SEEN)
continue;
t->object.flags |= SEEN;
if (!oidset_insert(&root_tree_set, oid))
oid_array_append(&root_tree_list->oids, oid);
} else {