summaryrefslogtreecommitdiff
path: root/include/git2/refs.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-05-08 02:28:47 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-05-08 02:28:47 +0200
commit4f2eb2b7f4cf6b2b6594887edd8948cb149c8052 (patch)
treef93422ce61b7a349b238d2d0642ef80f09b7bf55 /include/git2/refs.h
parentaf795759a7c1e753d440e3c3ca4dd5d8e391018c (diff)
downloadlibgit2-4f2eb2b7f4cf6b2b6594887edd8948cb149c8052.tar.gz
Introduce git_reference_shorthand
Generate a shorthand name out of the full refname.
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r--include/git2/refs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index e1d425352..bb3d21b06 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -493,6 +493,21 @@ GIT_EXTERN(int) git_reference_peel(
*/
GIT_EXTERN(int) git_reference_is_valid_name(const char *refname);
+/**
+ * Get the reference's short name
+ *
+ * This will transform the reference name into a name "human-readable"
+ * version. If no shortname is appropriate, it will return the full
+ * name.
+ *
+ * The memory is owned by the reference and must not be freed.
+ *
+ * @param ref a reference
+ * @return the human-readable version of the name
+ */
+GIT_EXTERN(const char *) git_reference_shorthand(git_reference *ref);
+
+
/** @} */
GIT_END_DECL
#endif