Skip to content

Commit e45350f

Browse files
committed
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 parent 6574cd0 commit e45350f

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

include/git2/deprecated.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ GIT_EXTERN(int) git_index_add_frombuffer(
291291
#define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
292292
#define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
293293

294+
GIT_EXTERN(int) git_tag_create_frombuffer(
295+
git_oid *oid,
296+
git_repository *repo,
297+
const char *buffer,
298+
int force);
299+
294300
/**@}*/
295301

296302
/** @name Deprecated Credential Callback Types

include/git2/tag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ GIT_EXTERN(int) git_tag_annotation_create(
217217
* @param force Overwrite existing tags
218218
* @return 0 on success; error code otherwise
219219
*/
220-
GIT_EXTERN(int) git_tag_create_frombuffer(
220+
GIT_EXTERN(int) git_tag_create_from_buffer(
221221
git_oid *oid,
222222
git_repository *repo,
223223
const char *buffer,

src/tag.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ int git_tag_create_lightweight(
328328
return git_tag_create__internal(oid, repo, tag_name, target, NULL, NULL, allow_ref_overwrite, 0);
329329
}
330330

331-
int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *buffer, int allow_ref_overwrite)
331+
int git_tag_create_from_buffer(git_oid *oid, git_repository *repo, const char *buffer, int allow_ref_overwrite)
332332
{
333333
git_tag tag;
334334
int error;
@@ -521,3 +521,10 @@ int git_tag_peel(git_object **tag_target, const git_tag *tag)
521521
{
522522
return git_object_peel(tag_target, (const git_object *)tag, GIT_OBJECT_ANY);
523523
}
524+
525+
/* Deprecated Functions */
526+
527+
int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *buffer, int allow_ref_overwrite)
528+
{
529+
return git_tag_create_from_buffer(oid, repo, buffer, allow_ref_overwrite);
530+
}

0 commit comments

Comments
 (0)