MCPcopy Create free account
hub / github.com/libgit2/git2go / SmartCredentials

Method SmartCredentials

transport.go:101–119  ·  view source on GitHub ↗

SmartCredentials calls the credentials callback for this transport.

(user string, methods CredentialType)

Source from the content-addressed store, hash-verified

99
100// SmartCredentials calls the credentials callback for this transport.
101func (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.
122func (t *Transport) SmartCertificateCheck(cert *Certificate, valid bool, hostname string) error {

Callers 2

sendRequestMethod · 0.80
ActionMethod · 0.80

Calls 4

newCredentialFunction · 0.85
MakeGitErrorFunction · 0.85
freeMethod · 0.80
FreeMethod · 0.65

Tested by

no test coverage detected