{
struct commit_list *parents;
- if (!commit)
- return;
parents = commit->parents;
commit->object.flags &= ~mark;
while (parents) {
- clear_commit_marks(parents->item, mark);
+ struct commit *parent = parents->item;
+ if (parent && parent->object.parsed &&
+ (parent->object.flags & mark))
+ clear_commit_marks(parent, mark);
parents = parents->next;
}
}
}
finish:
- if (cleanup) {
- clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
- clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);
- }
+ if (cleanup)
+ clear_object_marks(PARENT1 | PARENT2 | STALE);
return result;
}
objects[nr].name = name;
array->nr = ++nr;
}
+
+void clear_object_marks(unsigned mark)
+{
+ int i;
+
+ for (i = 0; i < obj_allocs; i++)
+ if (objs[i])
+ objs[i]->flags &= ~mark;
+}
/* Object array handling .. */
void add_object_array(struct object *obj, const char *name, struct object_array *array);
+void clear_object_marks(unsigned);
+
#endif /* OBJECT_H */