summaryrefslogtreecommitdiff
path: root/src/git2/refs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/git2/refs.h')
-rw-r--r--src/git2/refs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/git2/refs.h b/src/git2/refs.h
index 752d80862..1702d7ee1 100644
--- a/src/git2/refs.h
+++ b/src/git2/refs.h
@@ -39,6 +39,19 @@
GIT_BEGIN_DECL
/**
+ * Lookup a reference by its name in a repository.
+ *
+ * The generated reference is owned by the repository and
+ * should not be freed by the user.
+ *
+ * @param reference_out pointer to the looked-up reference
+ * @param repo the repository to look up the reference
+ * @param name the long name for the reference (e.g. HEAD, ref/heads/master, refs/tags/v0.1.0, ...)
+ * @return 0 on success; error code otherwise
+ */
+GIT_EXTERN(int) git_reference_lookup(git_reference **reference_out, git_repository *repo, const char *name);
+
+/**
* Create a new symbolic reference.
*
* The reference will be created in the repository and written