diff options
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/tag.h | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/include/git2/tag.h b/include/git2/tag.h index 71b27bb3e..3c3266183 100644 --- a/include/git2/tag.h +++ b/include/git2/tag.h @@ -149,7 +149,7 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *tag); /** - * Create a new tag in the repository from an OID + * Create a new tag in the repository from an object * * A new reference will also be created pointing to * this tag object. If `force` is true and a reference @@ -157,7 +157,7 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *tag); * * @param oid Pointer where to store the OID of the * newly created tag. If the tag already exists, this parameter - * will be the oid of the existed tag, and the function will + * will be the oid of the existing tag, and the function will * return a GIT_EEXISTS error code. * * @param repo Repository where to store the tag @@ -174,7 +174,7 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *tag); * * @param message Full message for this tag * - * @param force Overwritte existing references + * @param force Overwrite existing references * * @return 0 on success; error code otherwise. * A tag object is written to the ODB, and a proper reference @@ -205,6 +205,40 @@ GIT_EXTERN(int) git_tag_create_frombuffer( int force); /** + * Create a new lightweight tag pointing at a target object + * + * A new direct reference will be created pointing to + * this target object. If `force` is true and a reference + * already exists with the given name, it'll be replaced. + * + * @param oid Pointer where to store the OID of the provided + * target object. If the tag already exists, this parameter + * will be filled with the oid of the existing pointed object + * and the function will return a GIT_EEXISTS error code. + * + * @param repo Repository where to store the lightweight tag + * + * @param tag_name Name for the tag; this name is validated + * for consistency. It should also not conflict with an + * already existing tag name + * + * @param target Object to which this tag points. This object + * must belong to the given `repo`. + * + * @param force Overwrite existing references + * + * @return 0 on success; error code otherwise. + * A proper reference is written in the /refs/tags folder, + * pointing to the provided target object + */ +int git_tag_create_lightweight( + git_oid *oid, + git_repository *repo, + const char *tag_name, + const git_object *target, + int force); + +/** * Delete an existing tag reference. * * @param repo Repository where lives the tag |