Merge pull request #81 from jezell/remote-set-callbacks

add remote functions to set callbacks / set cert check
This commit is contained in:
Carlos Martín Nieto 2014-04-26 20:22:44 +02:00
commit dca2192492
1 changed files with 20 additions and 0 deletions

View File

@ -127,6 +127,26 @@ func RemoteIsValidName(name string) bool {
return false
}
func (r *Remote) SetCheckCert(check bool) {
C.git_remote_check_cert(r.ptr, cbool(check))
}
func (r *Remote) SetCallbacks(callbacks *RemoteCallbacks) error {
var ccallbacks C.git_remote_callbacks
populateRemoteCallbacks(&ccallbacks, callbacks)
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ecode := C.git_remote_set_callbacks(r.ptr, &ccallbacks)
if ecode < 0 {
return MakeGitError(ecode)
}
return nil
}
func (r *Remote) Free() {
runtime.SetFinalizer(r, nil)
C.git_remote_free(r.ptr)