1
0
mirror of https://gitea.com/gitea/tea.git synced 2024-11-03 04:27:21 -05:00

modules/git: fix dropped error (#127)

modules/git: fix dropped error

Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/127
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
alrs 2020-04-25 02:35:22 +00:00 committed by Lunny Xiao
parent e9dee07459
commit 35ad046d8d

View File

@ -81,6 +81,9 @@ func readSSHPrivKey(keyFile string) (sig ssh.Signer, err error) {
sig, err = ssh.ParsePrivateKey(sshKey) sig, err = ssh.ParsePrivateKey(sshKey)
if err != nil { if err != nil {
pass, err := promptPass(keyFile) pass, err := promptPass(keyFile)
if err != nil {
return nil, err
}
sig, err = ssh.ParsePrivateKeyWithPassphrase(sshKey, []byte(pass)) sig, err = ssh.ParsePrivateKeyWithPassphrase(sshKey, []byte(pass))
if err != nil { if err != nil {
return nil, err return nil, err