Add (*Repository).DeleteRemote

This commit is contained in:
Aaron O'Mullan 2014-11-26 22:05:21 +01:00
parent 1796304374
commit 5b3bc2dd1f
1 changed files with 14 additions and 0 deletions

View File

@ -278,6 +278,20 @@ func (repo *Repository) CreateRemote(name string, url string) (*Remote, error) {
return remote, nil
}
func (repo *Repository) DeleteRemote(name string) error {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_remote_delete(repo.ptr, cname)
if ret < 0 {
return MakeGitError(ret)
}
return nil
}
func (repo *Repository) CreateRemoteWithFetchspec(name string, url string, fetch string) (*Remote, error) {
remote := &Remote{}