summaryrefslogtreecommitdiff
path: root/tag.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2016-07-06 23:54:40 +0200
committerGitHub <[email protected]>2016-07-06 23:54:40 +0200
commitf720800b507b72c0d64cdae70e2058bc620adc24 (patch)
tree5c523caafb66f3274797b80291ec279f982379c7 /tag.go
parent30cffcb5261e8b43678eab0db7df9943ed99d60f (diff)
parent8b855ce7650de8aabb9d23c4cbfef9467c4d4f77 (diff)
Merge pull request #318 from netnose/tag-remove
Tag Remove
Diffstat (limited to 'tag.go')
-rw-r--r--tag.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/tag.go b/tag.go
index 8957430..81d7258 100644
--- a/tag.go
+++ b/tag.go
@@ -83,6 +83,21 @@ func (c *TagsCollection) Create(
return oid, nil
}
+func (c *TagsCollection) Remove(name string) error {
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
+ cname := C.CString(name)
+ defer C.free(unsafe.Pointer(cname))
+
+ ret := C.git_tag_delete(c.repo.ptr, cname)
+ if ret < 0 {
+ return MakeGitError(ret)
+ }
+
+ return nil
+}
+
// CreateLightweight creates a new lightweight tag pointing to a commit
// and returns the id of the target object.
//