summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-07-04 17:45:22 -0700
committerJunio C Hamano <junkio@cox.net>2006-07-04 17:45:22 -0700
commit58ecf5c1cd9b2f712f85e23f065d3214cd867a71 (patch)
treedc4e14e70cabc3b164321932e97ba67bbdc52e3a /commit.c
parent4205eca8de6163385eb1b6eb6577ef7acfe116e7 (diff)
downloadgit-58ecf5c1cd9b2f712f85e23f065d3214cd867a71.tar.gz
Re-fix clear_commit_marks().
Fix clear_commit_marks() enough to be usable in get_merge_bases(), and retire now unused clear_object_marks(). Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/commit.c b/commit.c
index 04390643e8..c6bf10d045 100644
--- a/commit.c
+++ b/commit.c
@@ -397,12 +397,13 @@ void clear_commit_marks(struct commit *commit, unsigned int mark)
{
struct commit_list *parents;
- parents = commit->parents;
commit->object.flags &= ~mark;
+ parents = commit->parents;
while (parents) {
struct commit *parent = parents->item;
- if (parent && parent->object.parsed &&
- (parent->object.flags & mark))
+
+ /* Have we already cleared this? */
+ if (mark & parent->object.flags)
clear_commit_marks(parent, mark);
parents = parents->next;
}
@@ -1083,8 +1084,10 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
}
finish:
- if (cleanup)
- clear_object_marks(PARENT1 | PARENT2 | STALE);
+ if (cleanup) {
+ clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
+ clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);
+ }
return result;
}