summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-10-11 13:21:13 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-10-25 16:33:27 +0000
commit63460fe4b5616cce01e4b67f0994e2e75415324d (patch)
tree2f7a55d06a13b1c3f788fbd7b14853d621438a8e /include/git2
parentb52bb4d4b2548d0c7f00de0eab5073cc8fe9e899 (diff)
downloadlibgit2-63460fe4b5616cce01e4b67f0994e2e75415324d.tar.gz
refs: deprecate git_reference_is_valid_name
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/deprecated.h24
-rw-r--r--include/git2/refs.h16
2 files changed, 21 insertions, 19 deletions
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 3f285018d..e24d057f4 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -340,10 +340,11 @@ GIT_EXTERN(size_t) git_object__size(git_object_t type);
/**@}*/
-/** @name Deprecated Reference Constants
+/** @name Deprecated Reference Functions and Constants
*
- * These enumeration values are retained for backward compatibility. The
- * newer versions of these values should be preferred in all new code.
+ * These functions and enumeration values are retained for backward
+ * compatibility. The newer versions of these values should be
+ * preferred in all new code.
*
* There is no plan to remove these backward compatibility values at
* this time.
@@ -364,6 +365,23 @@ GIT_EXTERN(size_t) git_object__size(git_object_t type);
#define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
#define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
+/**
+ * Ensure the reference name is well-formed.
+ *
+ * Valid reference names must follow one of two patterns:
+ *
+ * 1. Top-level names must contain only capital letters and underscores,
+ * and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
+ * 2. Names prefixed with "refs/" can be almost anything. You must avoid
+ * the characters '~', '^', ':', '\\', '?', '[', and '*', and the
+ * sequences ".." and "@{" which have special meaning to revparse.
+ *
+ * @deprecated Use git_reference_name_is_valid
+ * @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_EXTERN(int) git_tag_create_frombuffer(
git_oid *oid,
git_repository *repo,
diff --git a/include/git2/refs.h b/include/git2/refs.h
index 6145811bb..a20a1265b 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -750,22 +750,6 @@ GIT_EXTERN(int) git_reference_peel(
GIT_EXTERN(int) git_reference_name_is_valid(int *valid, const char *refname);
/**
- * Ensure the reference name is well-formed.
- *
- * Valid reference names must follow one of two patterns:
- *
- * 1. Top-level names must contain only capital letters and underscores,
- * and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
- * 2. Names prefixed with "refs/" can be almost anything. You must avoid
- * the characters '~', '^', ':', '\\', '?', '[', and '*', and the
- * sequences ".." and "@{" which have special meaning to revparse.
- *
- * @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);
-
-/**
* Get the reference's short name
*
* This will transform the reference name into a name "human-readable"