summaryrefslogtreecommitdiff
path: root/include/git2/refs.h
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-09-17 07:11:32 +0200
committernulltoken <emeric.fermas@gmail.com>2012-09-25 07:49:15 +0200
commit77e06d7e8547e82336489b7cdeb04294ed3d6015 (patch)
treec1715edc9ba6ae7ac17a23d4f4f46b36da7ac8ba /include/git2/refs.h
parentc030ada7ff7f9c93a2287ca2f57173d66fbff88a (diff)
downloadlibgit2-77e06d7e8547e82336489b7cdeb04294ed3d6015.tar.gz
refs: introduce git_reference_is_valid_name()
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r--include/git2/refs.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index acca69215..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),
@@ -452,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