tag: add underscore to `from` function The majority of functions are named `from_something` (with an underscore) instead of `fromsomething`. Update the tag function for consistency with the rest of the library.
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
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 8e0966d..3940724 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -291,6 +291,12 @@ GIT_EXTERN(int) git_index_add_frombuffer(
#define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
#define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
+GIT_EXTERN(int) git_tag_create_frombuffer(
+ git_oid *oid,
+ git_repository *repo,
+ const char *buffer,
+ int force);
+
/**@}*/
/** @name Deprecated Credential Callback Types
diff --git a/include/git2/tag.h b/include/git2/tag.h
index c2d490d..4e5fe1d 100644
--- a/include/git2/tag.h
+++ b/include/git2/tag.h
@@ -217,7 +217,7 @@ GIT_EXTERN(int) git_tag_annotation_create(
* @param force Overwrite existing tags
* @return 0 on success; error code otherwise
*/
-GIT_EXTERN(int) git_tag_create_frombuffer(
+GIT_EXTERN(int) git_tag_create_from_buffer(
git_oid *oid,
git_repository *repo,
const char *buffer,
diff --git a/src/tag.c b/src/tag.c
index 42c4e99..a7a005c 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -328,7 +328,7 @@ int git_tag_create_lightweight(
return git_tag_create__internal(oid, repo, tag_name, target, NULL, NULL, allow_ref_overwrite, 0);
}
-int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *buffer, int allow_ref_overwrite)
+int git_tag_create_from_buffer(git_oid *oid, git_repository *repo, const char *buffer, int allow_ref_overwrite)
{
git_tag tag;
int error;
@@ -521,3 +521,10 @@ int git_tag_peel(git_object **tag_target, const git_tag *tag)
{
return git_object_peel(tag_target, (const git_object *)tag, GIT_OBJECT_ANY);
}
+
+/* Deprecated Functions */
+
+int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *buffer, int allow_ref_overwrite)
+{
+ return git_tag_create_from_buffer(oid, repo, buffer, allow_ref_overwrite);
+}