summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-04-02 12:49:14 +0300
committerVicent Marti <tanoku@gmail.com>2011-04-02 12:50:25 +0300
commit3e3e4631a0362ba2358c9a2227e3cf0aaec8cf53 (patch)
tree33e4cd3bf2d605c280f6a62f440e76979289c43b /include
parent720d5472f8aa629161749450a27d3a4e3ecefea3 (diff)
parentac26e2454e71010821f2c85046b5cbd5a522d384 (diff)
downloadlibgit2-3e3e4631a0362ba2358c9a2227e3cf0aaec8cf53.tar.gz
Merge branch 'tagging' of https://github.com/nulltoken/libgit2 into development
Conflicts: include/git2/tag.h src/tag.c
Diffstat (limited to 'include')
-rw-r--r--include/git2/tag.h75
1 files changed, 74 insertions, 1 deletions
diff --git a/include/git2/tag.h b/include/git2/tag.h
index c47e3412c..c751a13c0 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
@@ -202,6 +203,78 @@ GIT_EXTERN(int) git_tag_create_frombuffer(
git_repository *repo,
const char *buffer);
+/**
+ * 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 _fo 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_fo(
+ git_oid *oid,
+ git_repository *repo,
+ const char *tag_name,
+ const git_object *target,
+ 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