예제 #1
0
파일: remote.go 프로젝트: jgrocho/go-git2
func (remote *Remote) Connect(direction Direction) error {
	ecode := C.git_remote_connect(remote.git_remote, C.int(direction))
	if ecode != git_SUCCESS {
		return gitError()
	}
	return nil
}
예제 #2
0
파일: remote.go 프로젝트: kissthink/git2go
func (o *Remote) Connect(direction ConnectDirection) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	if ret := C.git_remote_connect(o.ptr, C.git_direction(direction)); ret != 0 {
		return MakeGitError(ret)
	}
	return nil
}
예제 #3
0
func (o *Remote) Connect(direction ConnectDirection, callbacks *RemoteCallbacks) error {
	var ccallbacks C.git_remote_callbacks
	populateRemoteCallbacks(&ccallbacks, callbacks)

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	if ret := C.git_remote_connect(o.ptr, C.git_direction(direction), &ccallbacks); ret != 0 {
		return MakeGitError(ret)
	}
	return nil
}