summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-15 22:31:47 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-10-15 22:31:47 -0400
commitd55e7c3acf72413563e695a19f7f66efac442064 (patch)
treeb12d163ceb3e56e36a90c82b9c075a3401cd00d3 /commit.c
parent03618b9df84a0e94e36fdb27060e605e85b956e9 (diff)
parent8492f00b4f28471af84d3887096257822c4d2bc9 (diff)
downloadgit-d55e7c3acf72413563e695a19f7f66efac442064.tar.gz
Merge branch 'maint'
* maint: Whip post 1.5.3.4 maintenance series into shape. rebase -i: use diff plumbing instead of porcelain Do not remove distributed configure script git-archive: document --exec git-reflog: document --verbose git-config: handle --file option with relative pathname properly clear_commit_marks(): avoid deep recursion git add -i: Remove unused variables git add -i: Fix parsing of abbreviated hunk headers git-config: don't silently ignore options after --list Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT Fix embarrassing "git log --follow" bug Conflicts: RelNotes git-rebase--interactive.sh
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/commit.c b/commit.c
index 20fb2209cb..ac24266e93 100644
--- a/commit.c
+++ b/commit.c
@@ -441,17 +441,22 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
void clear_commit_marks(struct commit *commit, unsigned int mark)
{
- struct commit_list *parents;
+ while (commit) {
+ struct commit_list *parents;
- commit->object.flags &= ~mark;
- parents = commit->parents;
- while (parents) {
- struct commit *parent = parents->item;
+ if (!(mark & commit->object.flags))
+ return;
- /* Have we already cleared this? */
- if (mark & parent->object.flags)
- clear_commit_marks(parent, mark);
- parents = parents->next;
+ commit->object.flags &= ~mark;
+
+ parents = commit->parents;
+ if (!parents)
+ return;
+
+ while ((parents = parents->next))
+ clear_commit_marks(parents->item, mark);
+
+ commit = commit->parents->item;
}
}