Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/tag.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2013-03-02 01:37:33 +0400
committerEdward Thomson <ethomson@edwardthomson.com>2013-03-07 21:01:52 +0400
commitd00d54645d931c77a9b401518c0d73e3f640454b (patch)
treee1932dcc97172a53524e9db1ba4923cf137a4f9c /src/tag.c
parent6a9ef012376e8a21dcfd0499ab16048eb6e954c3 (diff)
immutable references and a pluggable ref database
Diffstat (limited to 'src/tag.c')
-rw-r--r--src/tag.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tag.c b/src/tag.c
index 592299e40..e52467f66 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -376,9 +376,9 @@ on_error:
int git_tag_delete(git_repository *repo, const char *tag_name)
{
- int error;
git_reference *tag_ref;
git_buf ref_name = GIT_BUF_INIT;
+ int error;
error = retrieve_tag_reference(&tag_ref, &ref_name, repo, tag_name);
@@ -387,7 +387,10 @@ int git_tag_delete(git_repository *repo, const char *tag_name)
if (error < 0)
return error;
- return git_reference_delete(tag_ref);
+ if ((error = git_reference_delete(tag_ref)) == 0)
+ git_reference_free(tag_ref);
+
+ return error;
}
int git_tag__parse(git_tag *tag, git_odb_object *obj)
@@ -426,8 +429,7 @@ int git_tag_foreach(git_repository *repo, git_tag_foreach_cb cb, void *cb_data)
data.cb_data = cb_data;
data.repo = repo;
- return git_reference_foreach(
- repo, GIT_REF_OID | GIT_REF_PACKED, &tags_cb, &data);
+ return git_reference_foreach(repo, GIT_REF_OID, &tags_cb, &data);
}
typedef struct {