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

Function NewCredentialSSHKeyFromAgent

credentials.go:215–228  ·  view source on GitHub ↗
(username string)

Source from the content-addressed store, hash-verified

213}
214
215func NewCredentialSSHKeyFromAgent(username string) (*Credential, error) {
216 runtime.LockOSThread()
217 defer runtime.UnlockOSThread()
218
219 cred := newCredential()
220 cusername := C.CString(username)
221 defer C.free(unsafe.Pointer(cusername))
222 ret := C.git_credential_ssh_key_from_agent(&cred.ptr, cusername)
223 if ret != 0 {
224 cred.Free()
225 return nil, MakeGitError(ret)
226 }
227 return cred, nil
228}
229
230type credentialSSHCustomData struct {
231 signer ssh.Signer

Callers 1

NewCredSshKeyFromAgentFunction · 0.85

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…