revert clear-commit-marks for now.
Earlier change broke "git describe A B" among other things.
Revert it for now, and clean the commits smudged by
get_merge_bases using clear_object_marks() function. For
complex commit ancestry graph, this is way cheaper as well.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/commit.c b/commit.c
index 12882fd..0439064 100644
--- a/commit.c
+++ b/commit.c
@@ -397,12 +397,13 @@
{
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;
}
}
@@ -1082,10 +1083,8 @@
}
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;
}