summaryrefslogtreecommitdiff
path: root/include/git2/graph.h
diff options
context:
space:
mode:
authorArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-28 19:39:14 +0100
committerArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-28 19:39:14 +0100
commite7c16943f4551830a148995640f87bec2fe08e8f (patch)
treee309913211b29ac99fd0c8a129bdc8f8bcc6dd6b /include/git2/graph.h
parenta1a9d0bd484edb26c579820190d8f5fda24276ef (diff)
downloadlibgit2-e7c16943f4551830a148995640f87bec2fe08e8f.tar.gz
Add `git_graph_descendant_of`.
Diffstat (limited to 'include/git2/graph.h')
-rw-r--r--include/git2/graph.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/git2/graph.h b/include/git2/graph.h
index a2710219e..c997d8ca9 100644
--- a/include/git2/graph.h
+++ b/include/git2/graph.h
@@ -36,6 +36,20 @@ GIT_BEGIN_DECL
*/
GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream);
+
+/**
+ * Determine if a commit is the descendant of another commit.
+ *
+ * @param commit a previously loaded commit.
+ * @param ancestor a potential ancestor commit.
+ * @return 1 if the given commit is a descendant of the potential ancestor,
+ * 0 if not, error code otherwise.
+ */
+GIT_EXTERN(int) git_graph_descendant_of(
+ git_repository *repo,
+ const git_oid *commit,
+ const git_oid *ancestor);
+
/** @} */
GIT_END_DECL
#endif