commit
f720800b50
|
@ -28,7 +28,7 @@ type Repository struct {
|
|||
// read, write and delete notes from this repository.
|
||||
Notes NoteCollection
|
||||
// Tags represents the collection of tags and can be used to create,
|
||||
// list and iterate tags in this repository.
|
||||
// list, iterate and remove tags in this repository.
|
||||
Tags TagsCollection
|
||||
}
|
||||
|
||||
|
|
15
tag.go
15
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.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue