summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-10-11 13:48:07 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-10-25 16:33:27 +0000
commit023ebb9a8ebdb5963000253cd127d4bf18312b50 (patch)
tree26e67a5f4abe92f1dfe3fef62c57c7eb4482e8ca /include
parent68e35588ad5b55c9f0357e0a33f7282c0a454a0c (diff)
downloadlibgit2-023ebb9a8ebdb5963000253cd127d4bf18312b50.tar.gz
refs: introduce git_remote_name_is_valid
Provide a function that can check remote name validity but can also signal when an error occurs. Use the name "name_is_valid", which is more suggestive of checking a given name, rather than "is_valid_name", which suggests that the function checks the validity of the current remote's name.
Diffstat (limited to 'include')
-rw-r--r--include/git2/remote.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 51d9c7235..fa0345eb5 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -915,6 +915,15 @@ GIT_EXTERN(int) git_remote_rename(
/**
* Ensure the remote name is well-formed.
*
+ * @param valid output pointer to set with validity of given remote name
+ * @param remote_name name to be checked.
+ * @return 0 on success or an error code
+ */
+int git_remote_name_is_valid(int *valid, const char *remote_name);
+
+/**
+ * Ensure the remote name is well-formed.
+ *
* @param remote_name name to be checked.
* @return 1 if the reference name is acceptable; 0 if it isn't
*/