mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
Update GoGitClient.go
FIX: More indenting then necessary.
This commit is contained in:
parent
0869eae34e
commit
8526911c17
@ -29,28 +29,28 @@ func (t ProgressWrapper) Write(p []byte) (n int, err error) {
|
||||
|
||||
func getAuthMethod(r GitRepository) (transport.AuthMethod, error) {
|
||||
if r.Repository.SSHKey.Type == db.AccessKeySSH {
|
||||
var sshKeyBuff = r.Repository.SSHKey.SshKey.PrivateKey
|
||||
var sshKeyBuff = r.Repository.SSHKey.SshKey.PrivateKey
|
||||
|
||||
if r.Repository.SSHKey.SshKey.Login == "" {
|
||||
r.Repository.SSHKey.SshKey.Login = "git"
|
||||
}
|
||||
if r.Repository.SSHKey.SshKey.Login == "" {
|
||||
r.Repository.SSHKey.SshKey.Login = "git"
|
||||
}
|
||||
|
||||
publicKey, sshErr := ssh.NewPublicKeys(r.Repository.SSHKey.SshKey.Login, []byte(sshKeyBuff), r.Repository.SSHKey.SshKey.Passphrase)
|
||||
publicKey, sshErr := ssh.NewPublicKeys(r.Repository.SSHKey.SshKey.Login, []byte(sshKeyBuff), r.Repository.SSHKey.SshKey.Passphrase)
|
||||
|
||||
if sshErr != nil {
|
||||
r.Logger.Log("Unable to creating ssh auth method")
|
||||
return nil, sshErr
|
||||
}
|
||||
publicKey.HostKeyCallback = ssh2.InsecureIgnoreHostKey()
|
||||
if sshErr != nil {
|
||||
r.Logger.Log("Unable to creating ssh auth method")
|
||||
return nil, sshErr
|
||||
}
|
||||
publicKey.HostKeyCallback = ssh2.InsecureIgnoreHostKey()
|
||||
|
||||
return publicKey, sshErr
|
||||
return publicKey, sshErr
|
||||
} else if r.Repository.SSHKey.Type == db.AccessKeyLoginPassword {
|
||||
password := &http.BasicAuth{
|
||||
Username: r.Repository.SSHKey.LoginPassword.Login,
|
||||
Password: r.Repository.SSHKey.LoginPassword.Password,
|
||||
}
|
||||
password := &http.BasicAuth{
|
||||
Username: r.Repository.SSHKey.LoginPassword.Login,
|
||||
Password: r.Repository.SSHKey.LoginPassword.Password,
|
||||
}
|
||||
|
||||
return password, nil
|
||||
return password, nil
|
||||
} else if r.Repository.SSHKey.Type == db.AccessKeyNone {
|
||||
return nil, nil
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user