remote: deprecate git_remote_is_valid_name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index e24d057..4e43c45 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -340,6 +340,27 @@ GIT_EXTERN(size_t) git_object__size(git_object_t type);
/**@}*/
+/** @name Deprecated Remote Functions
+ *
+ * These functions are retained for backward compatibility. The newer
+ * versions of these functions should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility functions at
+ * this time.
+ */
+/**@{*/
+
+/**
+ * Ensure the remote name is well-formed.
+ *
+ * @deprecated Use git_remote_name_is_valid
+ * @param remote_name name to be checked.
+ * @return 1 if the reference name is acceptable; 0 if it isn't
+ */
+GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
+
+/**@}*/
+
/** @name Deprecated Reference Functions and Constants
*
* These functions and enumeration values are retained for backward
diff --git a/include/git2/remote.h b/include/git2/remote.h
index fa0345e..b82bd25 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -922,14 +922,6 @@ GIT_EXTERN(int) git_remote_rename(
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
- */
-GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
-
-/**
* Delete an existing persisted remote.
*
* All remote-tracking branches and configuration settings
diff --git a/src/remote.c b/src/remote.c
index 6ebdaf8..f638248 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -2124,14 +2124,6 @@ done:
return error;
}
-int git_remote_is_valid_name(const char *remote_name)
-{
- int valid = 0;
-
- git_remote_name_is_valid(&valid, remote_name);
- return valid;
-}
-
git_refspec *git_remote__matching_refspec(git_remote *remote, const char *refname)
{
git_refspec *spec;
@@ -2628,3 +2620,17 @@ char *apply_insteadof(git_config *config, const char *url, int direction)
return result.ptr;
}
+
+/* Deprecated functions */
+
+#ifndef GIT_DEPRECATE_HARD
+
+int git_remote_is_valid_name(const char *remote_name)
+{
+ int valid = 0;
+
+ git_remote_name_is_valid(&valid, remote_name);
+ return valid;
+}
+
+#endif