summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/commit.h b/commit.h
index 491b2c148f..c24ab21061 100644
--- a/commit.h
+++ b/commit.h
@@ -54,4 +54,17 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
struct commit *pop_commit(struct commit_list **stack);
int count_parents(struct commit * commit);
+
+/*
+ * Performs an in-place topological sort of list supplied.
+ *
+ * Pre-conditions:
+ * all commits in input list and all parents of those
+ * commits must have object.util == NULL
+ *
+ * Post-conditions:
+ * invariant of resulting list is:
+ * a reachable from b => ord(b) < ord(a)
+ */
+void sort_in_topological_order(struct commit_list ** list);
#endif /* COMMIT_H */