Merge pull request #140 from AaronO/patch-1

Add wrapper for git_remote_delete : Repository.DeleteRemote
This commit is contained in:
Carlos Martín Nieto 2014-12-06 02:25:02 +01:00
commit 27ce026f1c
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{}