summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-01-14 12:41:01 -0800
committerVicent Marti <vicent@github.com>2014-01-14 12:41:01 -0800
commit3c1b3ded12afa443158287c22b81fb9419680072 (patch)
treeea697c05ae700d82624f9ecc67dce390a21fe403 /include
parent30aebe6334d5164ba58713d653d44b47632ee6d9 (diff)
parent529f342aba858e81f370aca9570fa149ebba674b (diff)
downloadlibgit2-3c1b3ded12afa443158287c22b81fb9419680072.tar.gz
Merge pull request #2047 from arthurschreiber/arthur/fix-dup-functions
Align `*_dup` functions
Diffstat (limited to 'include')
-rw-r--r--include/git2/signature.h7
-rw-r--r--include/git2/tree.h7
2 files changed, 8 insertions, 6 deletions
diff --git a/include/git2/signature.h b/include/git2/signature.h
index 2fa46d032..a1dd1ec7a 100644
--- a/include/git2/signature.h
+++ b/include/git2/signature.h
@@ -68,10 +68,11 @@ GIT_EXTERN(int) git_signature_default(git_signature **out, git_repository *repo)
*
* Call `git_signature_free()` to free the data.
*
- * @param sig signature to duplicated
- * @return a copy of sig, NULL on out of memory
+ * @param dest pointer where to store the copy
+ * @param entry signature to duplicate
+ * @return 0 or an error code
*/
-GIT_EXTERN(git_signature *) git_signature_dup(const git_signature *sig);
+GIT_EXTERN(int) git_signature_dup(git_signature **dest, const git_signature *sig);
/**
* Free an existing signature.
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 422365674..6350ada9b 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -150,10 +150,11 @@ GIT_EXTERN(int) git_tree_entry_bypath(
* Create a copy of a tree entry. The returned copy is owned by the user,
* and must be freed explicitly with `git_tree_entry_free()`.
*
- * @param entry A tree entry to duplicate
- * @return a copy of the original entry or NULL on error (alloc failure)
+ * @param dest pointer where to store the copy
+ * @param entry tree entry to duplicate
+ * @return 0 or an error code
*/
-GIT_EXTERN(git_tree_entry *) git_tree_entry_dup(const git_tree_entry *entry);
+GIT_EXTERN(int) git_tree_entry_dup(git_tree_entry **dest, const git_tree_entry *source);
/**
* Free a user-owned tree entry