summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArthur Schreiber <arthurschreiber@github.com>2016-04-22 10:34:17 -0700
committerArthur Schreiber <arthurschreiber@github.com>2016-04-22 10:34:17 -0700
commit908f24fd13085d06a99666a3b6b1c54f6d4392af (patch)
treec017202d1897c3392e754be9f3f3e819a7cf1527 /include
parent1dc449105b329ea4f8ea9982bc2da869d231c04a (diff)
downloadlibgit2-908f24fd13085d06a99666a3b6b1c54f6d4392af.tar.gz
Allow creating copies of `git_reference` objects.
Diffstat (limited to 'include')
-rw-r--r--include/git2/refs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index db84ed03a..dee28cb5b 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -462,6 +462,17 @@ GIT_EXTERN(int) git_reference_foreach_name(
void *payload);
/**
+ * Create a copy of an existing reference.
+ *
+ * Call `git_reference_free` to free the data.
+ *
+ * @param dest pointer where to store the copy
+ * @param source object to copy
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_reference_dup(git_reference **dest, git_reference *source);
+
+/**
* Free the given reference.
*
* @param ref git_reference