summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorSam <sam.c.day@gmail.com>2011-04-06 10:48:31 +1000
committerVicent Marti <tanoku@gmail.com>2011-04-08 03:33:46 +0300
commit5924b2822cf0d7edad3f68573950d139dfcaaf06 (patch)
tree9fef60db1e9197304b46d76c8a15208e4f23d5ba /src/commit.c
parent98ac67808559e8c2238a855feb6fedfc4b956984 (diff)
downloadlibgit2-5924b2822cf0d7edad3f68573950d139dfcaaf06.tar.gz
Added git_commit_tree_oid and git_commit_parent_oid.
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/commit.c b/src/commit.c
index 9fc3f0767..9621703c3 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -318,6 +318,7 @@ GIT_COMMIT_GETTER(const char *, message_short, commit->message_short)
GIT_COMMIT_GETTER(git_time_t, time, commit->committer->when.time)
GIT_COMMIT_GETTER(int, time_offset, commit->committer->when.offset)
GIT_COMMIT_GETTER(unsigned int, parentcount, commit->parent_oids.length)
+GIT_COMMIT_GETTER(const git_oid *, tree_oid, &commit->tree_oid);
int git_commit_tree(git_tree **tree_out, git_commit *commit)
@@ -338,4 +339,9 @@ int git_commit_parent(git_commit **parent, git_commit *commit, unsigned int n)
return git_commit_lookup(parent, commit->object.repo, parent_oid);
}
+const git_oid *git_commit_parent_oid(git_commit *commit, unsigned int n)
+{
+ assert(commit);
+ return git_vector_get(&commit->parent_oids, n);
+}