(username string, password string)
| 150 | } |
| 151 | |
| 152 | func 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. |
no test coverage detected
searching dependent graphs…