summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-07-11 16:30:46 +0200
committerVicent Marti <tanoku@gmail.com>2011-07-11 19:42:21 +0200
commitbfbb55628bee994b649117e787bc40749f4c5181 (patch)
tree6074198c775850e143ae39961d37386412fbe271 /include
parenteb1fd1d0cb092942e4818baea7152be5c042ba05 (diff)
downloadlibgit2-bfbb55628bee994b649117e787bc40749f4c5181.tar.gz
tag: Add creation of lightweight tag
Diffstat (limited to 'include')
-rw-r--r--include/git2/tag.h40
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