summaryrefslogtreecommitdiff
path: root/include/git2/commit.h
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-07-17 08:08:34 -0700
committerBen Straub <bstraub@github.com>2012-07-17 08:08:34 -0700
commitbfc65634050dc52e3ed6b4497ebbb511e39d6e1e (patch)
tree32b03847b8a152b69bc3b48b6bb32e7b8621f45e /include/git2/commit.h
parent1d68fcd04b21a2c5665d0ca6a5543e7166c73457 (diff)
parentea5d2ce4cfa6cec89e2d844a70d1eb24bb401c7d (diff)
downloadlibgit2-bfc65634050dc52e3ed6b4497ebbb511e39d6e1e.tar.gz
Merge branch 'development' into clone
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r--include/git2/commit.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 640adf5c2..e8ecc808b 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -179,6 +179,25 @@ GIT_EXTERN(int) git_commit_parent(git_commit **parent, git_commit *commit, unsig
GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned int n);
/**
+ * Get the commit object that is the <n>th generation ancestor
+ * of the named commit object, following only the first parents.
+ * The returned commit has to be freed by the caller.
+ *
+ * Passing `0` as the generation number returns another instance of the
+ * base commit itself.
+ *
+ * @param ancestor Pointer where to store the ancestor commit
+ * @param commit a previously loaded commit.
+ * @param n the requested generation
+ * @return 0 on success; GIT_ENOTFOUND if no matching ancestor exists
+ * or an error code
+ */
+GIT_EXTERN(int) git_commit_nth_gen_ancestor(
+ git_commit **ancestor,
+ const git_commit *commit,
+ unsigned int n);
+
+/**
* Create a new commit in the repository using `git_object`
* instances as parameters.
*