summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSven Strickroth <email@cs-ware.de>2020-09-09 10:48:00 +0200
committerEdward Thomson <ethomson@edwardthomson.com>2020-10-25 16:33:28 +0000
commit0caa4655ebdb7bf028df970d0651378d121fab3e (patch)
tree393ed8d70cd7e6d933459990e0679285c95f4df3 /include
parentfe11160c724853fe8469a9788c5992420e4638de (diff)
downloadlibgit2-0caa4655ebdb7bf028df970d0651378d121fab3e.tar.gz
Add git_tag_name_is_valid
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Diffstat (limited to 'include')
-rw-r--r--include/git2/tag.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/tag.h b/include/git2/tag.h
index 4e5fe1db1..a3921369d 100644
--- a/include/git2/tag.h
+++ b/include/git2/tag.h
@@ -365,6 +365,18 @@ GIT_EXTERN(int) git_tag_peel(
*/
GIT_EXTERN(int) git_tag_dup(git_tag **out, git_tag *source);
+/**
+ * Determine whether a tag name is valid, meaning that (when prefixed
+ * with `refs/tags/`) that it is a valid reference name, and that any
+ * additional tag name restrictions are imposed (eg, it cannot start
+ * with a `-`).
+ *
+ * @param valid output pointer to set with validity of given tag name
+ * @param name a tag name to test
+ * @return 0 on success or an error code
+ */
+GIT_EXTERN(int) git_tag_name_is_valid(int *valid, const char *name);
+
/** @} */
GIT_END_DECL
#endif