summaryrefslogtreecommitdiff
path: root/include/git2/blob.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/blob.h
parent684b35c41b9166645e2edb9bc708aa7ddf9c1f24 (diff)
downloadlibgit2-f0224772ee4300d55e11ab6f84cb3dd64b35ecfd.tar.gz
git_object_dup: introduce typesafe versions
Diffstat (limited to 'include/git2/blob.h')
-rw-r--r--include/git2/blob.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h
index f451593cd..6377fc2a2 100644
--- a/include/git2/blob.h
+++ b/include/git2/blob.h
@@ -259,6 +259,15 @@ GIT_EXTERN(int) git_blob_create_frombuffer(
*/
GIT_EXTERN(int) git_blob_is_binary(const git_blob *blob);
+/**
+ * Create an in-memory copy of a blob. The copy must be explicitly
+ * free'd or it will leak.
+ *
+ * @param out Pointer to store the copy of the object
+ * @param source Original object to copy
+ */
+GIT_EXTERN(int) git_blob_dup(git_blob **out, git_blob *source);
+
/** @} */
GIT_END_DECL
#endif