From 4d00dfd438a219b20145ec76b0e2c543d9b685d1 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Tue, 29 Mar 2011 21:21:47 +0200 Subject: [PATCH 01/10] Replace gitfo_unlink() calls with git_reference_delete() in refs related tests --- tests/t10-refs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/t10-refs.c b/tests/t10-refs.c index 413811c9d..8bdb75eab 100644 --- a/tests/t10-refs.c +++ b/tests/t10-refs.c @@ -227,9 +227,8 @@ BEGIN_TEST(create0, "create a new symbolic reference") must_pass(git_reference_resolve(&resolved_ref, looked_up_ref)); must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0); + git_reference_delete(looked_up_ref); git_repository_free(repo); - - must_pass(gitfo_unlink(ref_path)); /* TODO: replace with git_reference_delete() when available */ END_TEST BEGIN_TEST(create1, "create a deep symbolic reference") @@ -250,9 +249,8 @@ BEGIN_TEST(create1, "create a deep symbolic reference") must_pass(git_reference_resolve(&resolved_ref, looked_up_ref)); must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0); + git_reference_delete(looked_up_ref); git_repository_free(repo); - - must_pass(gitfo_unlink(ref_path)); /* TODO: replace with git_reference_delete() when available */ END_TEST BEGIN_TEST(create2, "create a new OID reference") @@ -290,9 +288,8 @@ BEGIN_TEST(create2, "create a new OID reference") must_pass(git_reference_lookup(&looked_up_ref, repo, new_head)); must_be_true(git_oid_cmp(&id, git_reference_oid(looked_up_ref)) == 0); + git_reference_delete(looked_up_ref); git_repository_free(repo); - - must_pass(gitfo_unlink(ref_path)); /* TODO: replace with git_reference_delete() when available */ END_TEST static const char *ref_name = "refs/heads/other"; From 2b9b99b6ed45d42627916f0d9e2105d61fd23b11 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Tue, 29 Mar 2011 21:29:30 +0200 Subject: [PATCH 02/10] Add test ensuring one can not create an oid reference which targets at an unknown id --- tests/t10-refs.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/t10-refs.c b/tests/t10-refs.c index 8bdb75eab..b1124b36f 100644 --- a/tests/t10-refs.c +++ b/tests/t10-refs.c @@ -292,6 +292,26 @@ BEGIN_TEST(create2, "create a new OID reference") git_repository_free(repo); END_TEST +BEGIN_TEST(create3, "Can not create a new OID reference which targets at an unknown id") + git_reference *new_reference, *looked_up_ref; + git_repository *repo; + git_oid id; + + const char *new_head = "refs/heads/new-head"; + + git_oid_mkstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644"); + + must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); + + /* Create and write the new object id reference */ + must_fail(git_reference_create_oid(&new_reference, repo, new_head, &id)); + + /* Ensure the reference can't be looked-up... */ + must_fail(git_reference_lookup(&looked_up_ref, repo, new_head)); + + git_repository_free(repo); +END_TEST + static const char *ref_name = "refs/heads/other"; static const char *ref_master_name = "refs/heads/master"; static const char *ref_branch_name = "refs/heads/branch"; @@ -889,6 +909,7 @@ BEGIN_SUITE(refs) ADD_TEST(create0); ADD_TEST(create1); ADD_TEST(create2); + ADD_TEST(create3); ADD_TEST(overwrite0); ADD_TEST(overwrite1); From 673de2cf59e2f573895f7b9239785c634ca9ba38 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 21:29:10 +0200 Subject: [PATCH 03/10] Fix misleading comments --- tests/t08-tag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/t08-tag.c b/tests/t08-tag.c index 70eeb28a6..09d131036 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -78,14 +78,14 @@ BEGIN_TEST(write0, "write a tag to the repository and read it again") git_oid_mkstr(&target_id, tagged_commit); - /* create signatures */ + /* create signature */ tagger = git_signature_new(TAGGER_NAME, TAGGER_EMAIL, 123456789, 60); must_be_true(tagger != NULL); must_pass(git_tag_create( &tag_id, /* out id */ repo, - "the-tag", /* do not update the HEAD */ + "the-tag", &target_id, GIT_OBJ_COMMIT, tagger, From 8e9a3d421755100891402670e5a709031205e664 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 21:46:19 +0200 Subject: [PATCH 04/10] Enforce the testing of the correct creation of a tag --- tests/t08-tag.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/t08-tag.c b/tests/t08-tag.c index 09d131036..d1847f353 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -94,6 +94,7 @@ BEGIN_TEST(write0, "write a tag to the repository and read it again") git_signature_free((git_signature *)tagger); must_pass(git_tag_lookup(&tag, repo, &tag_id)); + must_be_true(git_oid_cmp(git_tag_target_oid(tag), &target_id) == 0); /* Check attributes were set correctly */ tagger = git_tag_tagger(tag); From 6d3160148b7220e78e2898aaadb457edcec4c846 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 21:57:20 +0200 Subject: [PATCH 05/10] Add test demonstrating that one can create a tag pointing at a non existent target --- tests/t08-tag.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/tests/t08-tag.c b/tests/t08-tag.c index d1847f353..7b3c88649 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -72,7 +72,6 @@ BEGIN_TEST(write0, "write a tag to the repository and read it again") git_oid target_id, tag_id; const git_signature *tagger; git_reference *ref_tag; - /* char hex_oid[41]; */ must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); @@ -116,8 +115,50 @@ BEGIN_TEST(write0, "write a tag to the repository and read it again") END_TEST +BEGIN_TEST(write1, "write a tag to the repository which points to an unknown oid and read it again") + git_repository *repo; + git_tag *tag; + git_oid target_id, tag_id; + const git_signature *tagger; + git_reference *ref_tag; + git_object *zombie; + + must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); + + git_oid_mkstr(&target_id, "deadbeef1b46c854b31185ea97743be6a8774479"); + + /* create signature */ + tagger = git_signature_new(TAGGER_NAME, TAGGER_EMAIL, 123456789, 60); + must_be_true(tagger != NULL); + + must_pass(git_tag_create( + &tag_id, /* out id */ + repo, + "the-zombie-tag", + &target_id, + GIT_OBJ_COMMIT, + tagger, + TAGGER_MESSAGE)); + + git_signature_free((git_signature *)tagger); + + must_pass(git_tag_lookup(&tag, repo, &tag_id)); + + /* The non existent target can not be looked up */ + must_fail(git_tag_target(&zombie, tag)); + + must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/the-zombie-tag")); + + must_pass(git_reference_delete(ref_tag)); + must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)tag)); + + git_repository_free(repo); + +END_TEST + BEGIN_SUITE(tag) ADD_TEST(read0); ADD_TEST(write0); + ADD_TEST(write1); END_SUITE From bf4c39f92958b42f626fbf1d7fd95a74e62f3409 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 22:30:55 +0200 Subject: [PATCH 06/10] Prevent tag_create() from creating a conflicting reference --- include/git2/tag.h | 3 ++- src/tag.c | 18 +++++++++++------- tests/t08-tag.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/include/git2/tag.h b/include/git2/tag.h index ee92cd5c2..b83d44733 100644 --- a/include/git2/tag.h +++ b/include/git2/tag.h @@ -140,7 +140,8 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *t); * @param repo Repository where to store the tag * * @param tag_name Name for the tag; this name is validated - * for consistency + * for consistency. It should also not conflict with an + * already existing tag name * * @param target OID to which this tag points; note that no * validation is done on this OID. Use the _o version of this diff --git a/src/tag.c b/src/tag.c index 7baababbf..9a0069448 100644 --- a/src/tag.c +++ b/src/tag.c @@ -182,10 +182,18 @@ int git_tag_create( const char *type_str; char *tagger_str; + git_reference *new_ref; + + char ref_name[MAX_GITDIR_TREE_STRUCTURE_PATH_LENGTH]; int type_str_len, tag_name_len, tagger_str_len, message_len; int error; + /** Ensure the tag name doesn't conflict with an already existing reference **/ + git__joinpath(ref_name, GIT_REFS_TAGS_DIR, tag_name); + if (!git_reference_lookup(&new_ref, repo, ref_name)) + return GIT_EEXISTS; + type_str = git_object_type2string(target_type); @@ -223,14 +231,10 @@ int git_tag_create( error = stream->finalize_write(oid, stream); stream->free(stream); - if (error == GIT_SUCCESS) { - char ref_name[512]; - git_reference *new_ref; - git__joinpath(ref_name, GIT_REFS_TAGS_DIR, tag_name); - error = git_reference_create_oid(&new_ref, repo, ref_name, oid); - } + if (error < GIT_SUCCESS) + return error; - return error; + return git_reference_create_oid(&new_ref, repo, ref_name, oid); } diff --git a/tests/t08-tag.c b/tests/t08-tag.c index 7b3c88649..371f8621c 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -156,9 +156,38 @@ BEGIN_TEST(write1, "write a tag to the repository which points to an unknown oid END_TEST +BEGIN_TEST(write2, "Attempt to write a tag bearing the same name than an already existing tag") + git_repository *repo; + git_oid target_id, tag_id; + const git_signature *tagger; + + must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); + + git_oid_mkstr(&target_id, tagged_commit); + + /* create signature */ + tagger = git_signature_new(TAGGER_NAME, TAGGER_EMAIL, 123456789, 60); + must_be_true(tagger != NULL); + + must_fail(git_tag_create( + &tag_id, /* out id */ + repo, + "very-simple", + &target_id, + GIT_OBJ_COMMIT, + tagger, + TAGGER_MESSAGE)); + + git_signature_free((git_signature *)tagger); + + git_repository_free(repo); + +END_TEST + BEGIN_SUITE(tag) ADD_TEST(read0); ADD_TEST(write0); ADD_TEST(write1); + ADD_TEST(write2); END_SUITE From 74e50a2d3e53e52ede430dca4ebc5efb2a38de4e Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 22:46:52 +0200 Subject: [PATCH 07/10] Fix memory leak in tag releated tests --- tests/t08-tag.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/t08-tag.c b/tests/t08-tag.c index 371f8621c..a5bdee3e0 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -58,6 +58,9 @@ BEGIN_TEST(read0, "read and parse a tag from the repository") must_be_true(git_oid_cmp(&id_commit, git_commit_id(commit)) == 0); + git_tag_close(tag1); + git_tag_close(tag2); + git_commit_close(commit); git_repository_free(repo); END_TEST @@ -111,6 +114,7 @@ BEGIN_TEST(write0, "write a tag to the repository and read it again") must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)tag)); + git_tag_close(tag); git_repository_free(repo); END_TEST @@ -152,6 +156,7 @@ BEGIN_TEST(write1, "write a tag to the repository which points to an unknown oid must_pass(git_reference_delete(ref_tag)); must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)tag)); + git_tag_close(tag); git_repository_free(repo); END_TEST From a50c145855598b53463c3715f399cd5ebf27240d Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 23:16:30 +0200 Subject: [PATCH 08/10] Add git_tag_create_o_f() and git_tag_create_f() which overwrite existing tag reference, if any --- include/git2/tag.h | 58 +++++++++++++++++++++++ src/tag.c | 111 ++++++++++++++++++++++++++++++++++++--------- tests/t08-tag.c | 36 +++++++++++++++ 3 files changed, 183 insertions(+), 22 deletions(-) diff --git a/include/git2/tag.h b/include/git2/tag.h index b83d44733..6468cfdd7 100644 --- a/include/git2/tag.h +++ b/include/git2/tag.h @@ -189,6 +189,64 @@ GIT_EXTERN(int) git_tag_create_o( const git_signature *tagger, const char *message); +/** +* Create a new tag in the repository from an OID +* and overwrite an already existing tag reference, if any. +* +* @param oid Pointer where to store the OID of the +* newly created tag +* +* @param repo Repository where to store the tag +* +* @param tag_name Name for the tag; this name is validated +* for consistency. +* +* @param target OID to which this tag points; note that no +* validation is done on this OID. Use the _o_f version of this +* method to assure a proper object is being tagged +* +* @param target_type Type of the tagged OID; note that no +* validation is performed here either +* +* @param tagger Signature of the tagger for this tag, and +* of the tagging time +* +* @param message Full message for this tag +* +* @return 0 on success; error code otherwise. +* A tag object is written to the ODB, and a proper reference +* is written in the /refs/tags folder, pointing to it +*/ +GIT_EXTERN(int) git_tag_create_f( + git_oid *oid, + git_repository *repo, + const char *tag_name, + const git_oid *target, + git_otype target_type, + const git_signature *tagger, + const char *message); + +/** + * Create a new tag in the repository from an existing + * `git_object` instance and overwrite an already existing + * tag reference, if any. + * + * This method replaces the `target` and `target_type` + * paremeters of `git_tag_create_f` by a single instance + * of a `const git_object *`, which is assured to be + * a proper object in the ODB and hence will create + * a valid tag + * + * @see git_tag_create_f + */ +GIT_EXTERN(int) git_tag_create_o_f( + git_oid *oid, + git_repository *repo, + const char *tag_name, + const git_object *target, + const git_signature *tagger, + const char *message); + /** @} */ GIT_END_DECL #endif diff --git a/src/tag.c b/src/tag.c index 9a0069448..e75c46916 100644 --- a/src/tag.c +++ b/src/tag.c @@ -153,29 +153,15 @@ static int parse_tag_buffer(git_tag *tag, char *buffer, const char *buffer_end) return GIT_SUCCESS; } -int git_tag_create_o( - git_oid *oid, - git_repository *repo, - const char *tag_name, - const git_object *target, - const git_signature *tagger, - const char *message) -{ - return git_tag_create( - oid, repo, tag_name, - git_object_id(target), - git_object_type(target), - tagger, message); -} - -int git_tag_create( +static int tag_create( git_oid *oid, git_repository *repo, const char *tag_name, const git_oid *target, git_otype target_type, const git_signature *tagger, - const char *message) + const char *message, + int allow_ref_overwrite) { size_t final_size = 0; git_odb_stream *stream; @@ -187,12 +173,27 @@ int git_tag_create( char ref_name[MAX_GITDIR_TREE_STRUCTURE_PATH_LENGTH]; int type_str_len, tag_name_len, tagger_str_len, message_len; - int error; + int error, should_update_ref = 0; - /** Ensure the tag name doesn't conflict with an already existing reference **/ + /** Ensure the tag name doesn't conflict with an already existing + reference unless overwriting has explictly been requested **/ git__joinpath(ref_name, GIT_REFS_TAGS_DIR, tag_name); - if (!git_reference_lookup(&new_ref, repo, ref_name)) - return GIT_EEXISTS; + error = git_reference_lookup(&new_ref, repo, ref_name); + + switch (error) { + case GIT_SUCCESS: + if (!allow_ref_overwrite) + return GIT_EEXISTS; + should_update_ref = 1; + + /* Fall trough */ + + case GIT_ENOTFOUND: + break; + + default: + return error; + } type_str = git_object_type2string(target_type); @@ -234,9 +235,75 @@ int git_tag_create( if (error < GIT_SUCCESS) return error; - return git_reference_create_oid(&new_ref, repo, ref_name, oid); + if (!should_update_ref) + error = git_reference_create_oid(&new_ref, repo, ref_name, oid); + else + error = git_reference_set_oid(new_ref, oid); + + return error; } +int git_tag_create_o( + git_oid *oid, + git_repository *repo, + const char *tag_name, + const git_object *target, + const git_signature *tagger, + const char *message) +{ + return tag_create( + oid, repo, tag_name, + git_object_id(target), + git_object_type(target), + tagger, message, 0); +} + +int git_tag_create( + git_oid *oid, + git_repository *repo, + const char *tag_name, + const git_oid *target, + git_otype target_type, + const git_signature *tagger, + const char *message) +{ + return tag_create( + oid, repo, tag_name, + target, + target_type, + tagger, message, 0); +} + +int git_tag_create_o_f( + git_oid *oid, + git_repository *repo, + const char *tag_name, + const git_object *target, + const git_signature *tagger, + const char *message) +{ + return tag_create( + oid, repo, tag_name, + git_object_id(target), + git_object_type(target), + tagger, message, 1); +} + +int git_tag_create_f( + git_oid *oid, + git_repository *repo, + const char *tag_name, + const git_oid *target, + git_otype target_type, + const git_signature *tagger, + const char *message) +{ + return tag_create( + oid, repo, tag_name, + target, + target_type, + tagger, message, 1); +} int git_tag__parse(git_tag *tag, git_odb_object *obj) { diff --git a/tests/t08-tag.c b/tests/t08-tag.c index a5bdee3e0..2bea4bc95 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -189,10 +189,46 @@ BEGIN_TEST(write2, "Attempt to write a tag bearing the same name than an already END_TEST +BEGIN_TEST(write3, "Replace an already existing tag") + git_repository *repo; + git_oid target_id, tag_id, old_tag_id; + const git_signature *tagger; + git_reference *ref_tag; + + must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER)); + + git_oid_mkstr(&target_id, tagged_commit); + + must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/very-simple")); + git_oid_cpy(&old_tag_id, git_reference_oid(ref_tag)); + + /* create signature */ + tagger = git_signature_new(TAGGER_NAME, TAGGER_EMAIL, 123456789, 60); + must_be_true(tagger != NULL); + + must_pass(git_tag_create_f( + &tag_id, /* out id */ + repo, + "very-simple", + &target_id, + GIT_OBJ_COMMIT, + tagger, + TAGGER_MESSAGE)); + + git_signature_free((git_signature *)tagger); + + must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/very-simple")); + must_be_true(git_oid_cmp(git_reference_oid(ref_tag), &tag_id) == 0); + must_be_true(git_oid_cmp(git_reference_oid(ref_tag), &old_tag_id) != 0); + + close_temp_repo(repo); + +END_TEST BEGIN_SUITE(tag) ADD_TEST(read0); ADD_TEST(write0); ADD_TEST(write1); ADD_TEST(write2); + ADD_TEST(write3); END_SUITE From 9e680bcc002af8f230bfce8dbfee3fef4001fb38 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 23:26:36 +0200 Subject: [PATCH 09/10] Add git_tag_delete() --- include/git2/tag.h | 14 ++++++++++++++ src/tag.c | 31 +++++++++++++++++++++++++++++-- tests/t08-tag.c | 14 ++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/include/git2/tag.h b/include/git2/tag.h index 6468cfdd7..1ee1e0cc4 100644 --- a/include/git2/tag.h +++ b/include/git2/tag.h @@ -247,6 +247,20 @@ GIT_EXTERN(int) git_tag_create_o_f( const git_signature *tagger, const char *message); +/** +* Delete an existing tag reference. +* +* @param repo Repository where lives the tag +* +* @param tag_name Name of the tag to be deleted; +* this name is validated for consistency. +* +* @return 0 on success; error code otherwise. +*/ +GIT_EXTERN(int) git_tag_delete( + git_repository *repo, + const char *tag_name); + /** @} */ GIT_END_DECL #endif diff --git a/src/tag.c b/src/tag.c index e75c46916..ff2d0abe7 100644 --- a/src/tag.c +++ b/src/tag.c @@ -153,6 +153,21 @@ static int parse_tag_buffer(git_tag *tag, char *buffer, const char *buffer_end) return GIT_SUCCESS; } +static int retreive_tag_reference(git_reference **tag_reference_out, char *ref_name_out, git_repository *repo, const char *tag_name) +{ + git_reference *tag_ref; + int error; + + git__joinpath(ref_name_out, GIT_REFS_TAGS_DIR, tag_name); + error = git_reference_lookup(&tag_ref, repo, ref_name_out); + if (error < GIT_SUCCESS) + return error; + + *tag_reference_out = tag_ref;; + + return GIT_SUCCESS; +} + static int tag_create( git_oid *oid, git_repository *repo, @@ -177,8 +192,7 @@ static int tag_create( /** Ensure the tag name doesn't conflict with an already existing reference unless overwriting has explictly been requested **/ - git__joinpath(ref_name, GIT_REFS_TAGS_DIR, tag_name); - error = git_reference_lookup(&new_ref, repo, ref_name); + error = retreive_tag_reference(&new_ref, ref_name, repo, tag_name); switch (error) { case GIT_SUCCESS: @@ -305,6 +319,19 @@ int git_tag_create_f( tagger, message, 1); } +int git_tag_delete(git_repository *repo, const char *tag_name) +{ + int error; + git_reference *tag_ref; + char ref_name[MAX_GITDIR_TREE_STRUCTURE_PATH_LENGTH]; + + error = retreive_tag_reference(&tag_ref, ref_name, repo, tag_name); + if (error < GIT_SUCCESS) + return error; + + return git_reference_delete(tag_ref); +} + int git_tag__parse(git_tag *tag, git_odb_object *obj) { assert(tag); diff --git a/tests/t08-tag.c b/tests/t08-tag.c index 2bea4bc95..ebb7a1f9c 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -225,6 +225,20 @@ BEGIN_TEST(write3, "Replace an already existing tag") END_TEST +BEGIN_TEST(write4, "Delete an already existing tag") + git_repository *repo; + git_reference *ref_tag; + + must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER)); + + must_pass(git_tag_delete(repo,"very-simple")); + + must_fail(git_reference_lookup(&ref_tag, repo, "refs/tags/very-simple")); + + close_temp_repo(repo); + +END_TEST + BEGIN_SUITE(tag) ADD_TEST(read0); ADD_TEST(write0); From ac26e2454e71010821f2c85046b5cbd5a522d384 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 30 Mar 2011 23:46:54 +0200 Subject: [PATCH 10/10] Rename git_tag_create_o_f() to git_tag_create_fo() --- include/git2/tag.h | 4 ++-- src/tag.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/git2/tag.h b/include/git2/tag.h index 1ee1e0cc4..0a37f6c39 100644 --- a/include/git2/tag.h +++ b/include/git2/tag.h @@ -202,7 +202,7 @@ GIT_EXTERN(int) git_tag_create_o( * for consistency. * * @param target OID to which this tag points; note that no -* validation is done on this OID. Use the _o_f version of this +* validation is done on this OID. Use the _fo version of this * method to assure a proper object is being tagged * * @param target_type Type of the tagged OID; note that no @@ -239,7 +239,7 @@ GIT_EXTERN(int) git_tag_create_f( * * @see git_tag_create_f */ -GIT_EXTERN(int) git_tag_create_o_f( +GIT_EXTERN(int) git_tag_create_fo( git_oid *oid, git_repository *repo, const char *tag_name, diff --git a/src/tag.c b/src/tag.c index ff2d0abe7..5a1101a19 100644 --- a/src/tag.c +++ b/src/tag.c @@ -288,7 +288,7 @@ int git_tag_create( tagger, message, 0); } -int git_tag_create_o_f( +int git_tag_create_fo( git_oid *oid, git_repository *repo, const char *tag_name,