diff options
author | Vicent Martà <vicent@github.com> | 2013-05-31 03:09:38 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-05-31 03:09:38 -0700 |
commit | 9afc59710ebfd63f0265aec79bc5388e610935a1 (patch) | |
tree | 6236ff7246494726a699cc1f6ca055d05c864551 /include/git2/refs.h | |
parent | af2c72d228eab2d380d47cb7a5c19ba562340429 (diff) | |
parent | 4f2eb2b7f4cf6b2b6594887edd8948cb149c8052 (diff) | |
download | libgit2-9afc59710ebfd63f0265aec79bc5388e610935a1.tar.gz |
Merge pull request #1559 from carlosmn/ref-shorthand
Introduce git_reference_shorthand
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r-- | include/git2/refs.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h index 468d0f930..56e8c6c38 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -525,6 +525,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 |