func (c *RemoteCollection) CreateAnonymous(url string) (*Remote, error) { remote := &Remote{} curl := C.CString(url) defer C.free(unsafe.Pointer(curl)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_remote_create_anonymous(&remote.ptr, c.repo.ptr, curl) if ret < 0 { return nil, MakeGitError(ret) } runtime.SetFinalizer(remote, (*Remote).Free) return remote, nil }
func (repo *Repository) CreateAnonymousRemote(url, fetch string) (*Remote, error) { remote := &Remote{} curl := C.CString(url) defer C.free(unsafe.Pointer(curl)) cfetch := C.CString(fetch) defer C.free(unsafe.Pointer(cfetch)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_remote_create_anonymous(&remote.ptr, repo.ptr, curl, cfetch) if ret < 0 { return nil, MakeGitError(ret) } runtime.SetFinalizer(remote, (*Remote).Free) return remote, nil }