summaryrefslogtreecommitdiff
path: root/include/git2/commit.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-02-17 18:04:19 +0000
committerEdward Thomson <ethomson@github.com>2016-03-23 17:08:37 -0400
commitf0224772ee4300d55e11ab6f84cb3dd64b35ecfd (patch)
tree5f4857f12f0268973f8d4a758043413f4b164f0d /include/git2/commit.h
parent684b35c41b9166645e2edb9bc708aa7ddf9c1f24 (diff)
downloadlibgit2-f0224772ee4300d55e11ab6f84cb3dd64b35ecfd.tar.gz
git_object_dup: introduce typesafe versions
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r--include/git2/commit.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index f63a90685..4cc637466 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -461,6 +461,15 @@ GIT_EXTERN(int) git_commit_create_with_signature(
const char *signature,
const char *signature_field);
+/**
+ * Create an in-memory copy of a commit. The copy must be explicitly
+ * free'd or it will leak.
+ *
+ * @param out Pointer to store the copy of the commit
+ * @param source Original commit to copy
+ */
+GIT_EXTERN(int) git_commit_dup(git_commit **out, git_commit *source);
+
/** @} */
GIT_END_DECL
#endif