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

Function NewCredentialUserpassPlaintext

credentials.go:152–167  ·  view source on GitHub ↗
(username string, password string)

Source from the content-addressed store, hash-verified

150}
151
152func NewCredentialUserpassPlaintext(username string, password string) (*Credential, error) {
153 runtime.LockOSThread()
154 defer runtime.UnlockOSThread()
155
156 cred := newCredential()
157 cusername := C.CString(username)
158 defer C.free(unsafe.Pointer(cusername))
159 cpassword := C.CString(password)
160 defer C.free(unsafe.Pointer(cpassword))
161 ret := C.git_credential_userpass_plaintext_new(&cred.ptr, cusername, cpassword)
162 if ret != 0 {
163 cred.Free()
164 return nil, MakeGitError(ret)
165 }
166 return cred, nil
167}
168
169// NewCredentialSSHKey creates new ssh credentials reading the public and private keys
170// from the file system.

Callers 1

NewCredUserpassPlaintextFunction · 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…