Skip to content

Commit d53e464

Browse files
committed
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 <[email protected]>
1 parent ed7f388 commit d53e464

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

path-walk.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ int walk_objects_by_path(struct path_walk_info *info)
360360
oid = get_commit_tree_oid(c);
361361
t = lookup_tree(info->revs->repo, oid);
362362

363-
if (t->object.flags & SEEN)
364-
continue;
365-
t->object.flags |= SEEN;
366-
367363
if (t) {
364+
if (t->object.flags & SEEN)
365+
continue;
366+
t->object.flags |= SEEN;
367+
368368
if (!oidset_insert(&root_tree_set, oid))
369369
oid_array_append(&root_tree_list->oids, oid);
370370
} else {

0 commit comments

Comments
 (0)