From 8b855ce7650de8aabb9d23c4cbfef9467c4d4f77 Mon Sep 17 00:00:00 2001 From: Mirko Nosenzo Date: Sun, 29 May 2016 14:46:55 +0200 Subject: Tag Remove Added support for removal of a Tag --- tag.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tag.go') 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. // -- cgit v1.2.3