summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-05-09 05:43:25 -0700
committerVicent Martí <vicent@github.com>2013-05-09 05:43:25 -0700
commit503dd0f3c4f798b02e0173dde7e3631d6e860c42 (patch)
tree9ab5dc42027803bb072eda4b997199a4dba6b99e /include
parentddc5c05421ba17650208cdb2da718d738c67329e (diff)
parent98d633cccf0a214b83ebfe9c7cb8ca449a1f0637 (diff)
downloadlibgit2-503dd0f3c4f798b02e0173dde7e3631d6e860c42.tar.gz
Merge pull request #1560 from carlosmn/ref-dwim
Expose git_reference_dwim
Diffstat (limited to 'include')
-rw-r--r--include/git2/refs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index e1d425352..e78873408 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -55,6 +55,19 @@ GIT_EXTERN(int) git_reference_name_to_id(
git_oid *out, git_repository *repo, const char *name);
/**
+ * Lookup a reference by DWIMing its short name
+ *
+ * Apply the git precendence rules to the given shorthand to determine
+ * which reference the user is refering to.
+ *
+ * @param out pointer in which to store the reference
+ * @param repo the repository in which to look
+ * @param shrothand the short name for the reference
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_reference_dwim(git_reference **out, git_repository *repo, const char *shorthand);
+
+/**
* Create a new symbolic reference.
*
* A symbolic reference is a reference name that refers to another