diff options
| author | Vicent Martà <vicent@github.com> | 2012-09-25 14:35:33 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2012-09-25 14:35:33 -0700 |
| commit | 3f7c5497c3c93431f01e7f892c71f71f7ef6e655 (patch) | |
| tree | 11fbf058764125e09358fdcc4f778b1cbb3bdf51 /include/git2 | |
| parent | d75074f4c02e8d8928d20261a891d94d26d41ea7 (diff) | |
| parent | 0adfa20aefcd18262214a22042d303721cc7d23a (diff) | |
| download | libgit2-3f7c5497c3c93431f01e7f892c71f71f7ef6e655.tar.gz | |
Merge pull request #938 from nulltoken/topic/is_valid_name
Topic/is valid name
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/refs.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h index 73b32a9e2..10b73f0c9 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -392,7 +392,8 @@ enum { /** * Control whether one-level refnames are accepted * (i.e., refnames that do not contain multiple /-separated - * components) + * components). Those are expected to be written only using + * uppercase letters and underscore (FETCH_HEAD, ...) */ GIT_REF_FORMAT_ALLOW_ONELEVEL = (1 << 0), @@ -414,8 +415,6 @@ enum { * Once normalized, if the reference name is valid, it will be * returned in the user allocated buffer. * - * TODO: Implement handling of GIT_REF_FORMAT_REFSPEC_PATTERN - * * @param buffer_out The user allocated buffer where the * normalized name will be stored. * @@ -454,6 +453,16 @@ GIT_EXTERN(int) git_reference_peel( git_reference *ref, git_otype type); +/** + * Ensure the reference name is well-formed. + * + * @param refname name to be checked. + * + * @return 1 if the reference name is acceptable; 0 if it isn't + */ +GIT_EXTERN(int) git_reference_is_valid_name( + const char *refname); + /** @} */ GIT_END_DECL #endif |
