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>
diff --git a/commit.c b/commit.c
index 0439064..c6bf10d 100644
--- a/commit.c
+++ b/commit.c
@@ -397,12 +397,13 @@
 {
 	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 @@
 	}
 
  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;
 }