summaryrefslogtreecommitdiff
path: root/src/git/commit.h
diff options
context:
space:
mode:
authorJustin Love <git@JustinLove.name>2010-11-30 21:28:39 -0600
committerJustin Love <git@JustinLove.name>2010-11-30 21:28:39 -0600
commiteb095435f338b97f305148e122d6e12fd81621ca (patch)
tree98eff25fe6f39bc49ddae810fe2c4f1bd8a96bd2 /src/git/commit.h
parent12114415ab62f7b7958f33bc7229963061b269df (diff)
downloadlibgit2-eb095435f338b97f305148e122d6e12fd81621ca.tar.gz
add git_commit_parent to retrieve a parent by index
Diffstat (limited to 'src/git/commit.h')
-rw-r--r--src/git/commit.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/git/commit.h b/src/git/commit.h
index cc4e7a073..70b08e94f 100644
--- a/src/git/commit.h
+++ b/src/git/commit.h
@@ -102,6 +102,14 @@ GIT_EXTERN(const git_tree *) git_commit_tree(git_commit *commit);
GIT_EXTERN(unsigned int) git_commit_parentcount(git_commit *commit);
/**
+ * Get the specified parent of the commit.
+ * @param commit a previously loaded commit.
+ * @param n the position of the entry
+ * @return a pointer to the commit; NULL if out of bounds
+ */
+GIT_EXTERN(git_commit *) git_commit_parent(git_commit *commit, unsigned int n);
+
+/**
* Add a new parent commit to an existing commit
* @param commit the commit object
* @param new_parent the new commit which will be a parent