From 0caa4655ebdb7bf028df970d0651378d121fab3e Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 9 Sep 2020 10:48:00 +0200 Subject: Add git_tag_name_is_valid Signed-off-by: Sven Strickroth --- include/git2/tag.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/git2') 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 -- cgit v1.2.1