summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/refs.h15
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