SmartCredentials calls the credentials callback for this transport.
(user string, methods CredentialType)
| 99 | |
| 100 | // SmartCredentials calls the credentials callback for this transport. |
| 101 | func (t *Transport) SmartCredentials(user string, methods CredentialType) (*Credential, error) { |
| 102 | cred := newCredential() |
| 103 | var cstr *C.char |
| 104 | |
| 105 | runtime.LockOSThread() |
| 106 | defer runtime.UnlockOSThread() |
| 107 | |
| 108 | if user != "" { |
| 109 | cstr = C.CString(user) |
| 110 | defer C.free(unsafe.Pointer(cstr)) |
| 111 | } |
| 112 | ret := C.git_transport_smart_credentials(&cred.ptr, t.ptr, cstr, C.int(methods)) |
| 113 | if ret != 0 { |
| 114 | cred.Free() |
| 115 | return nil, MakeGitError(ret) |
| 116 | } |
| 117 | |
| 118 | return cred, nil |
| 119 | } |
| 120 | |
| 121 | // SmartCertificateCheck calls the certificate check for this transport. |
| 122 | func (t *Transport) SmartCertificateCheck(cert *Certificate, valid bool, hostname string) error { |
no test coverage detected