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
1 changed files with 3 additions and 0 deletions

View File

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