summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commit.c13
-rw-r--r--commit.h2
-rw-r--r--describe.c3
3 files changed, 17 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index edd4dedcdd..e9a29caa27 100644
--- a/commit.c
+++ b/commit.c
@@ -352,6 +352,19 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
return ret;
}
+void clear_commit_marks(struct commit *commit, unsigned int mark)
+{
+ struct commit_list *parents;
+
+ parents = commit->parents;
+ commit->object.flags &= ~mark;
+ while (parents) {
+ if (parents->item && parents->item->object.parsed)
+ clear_commit_marks(parents->item, mark);
+ parents = parents->next;
+ }
+}
+
/*
* Generic support for pretty-printing the header
*/
diff --git a/commit.h b/commit.h
index 6738a696d7..9c4a244bd9 100644
--- a/commit.h
+++ b/commit.h
@@ -58,6 +58,8 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
struct commit *pop_commit(struct commit_list **stack);
+void clear_commit_marks(struct commit *commit, unsigned int mark);
+
int count_parents(struct commit * commit);
/*
diff --git a/describe.c b/describe.c
index 84d96b5b82..00fa02adcc 100644
--- a/describe.c
+++ b/describe.c
@@ -124,9 +124,10 @@ static void describe(struct commit *cmit)
if (n) {
printf("%s-g%s\n", n->path,
find_unique_abbrev(cmit->object.sha1, abbrev));
- return;
+ break;
}
}
+ clear_commit_marks(cmit, SEEN);
}
int main(int argc, char **argv)