From 35ad046d8d41e4392a17268e1bc507a84af2651f Mon Sep 17 00:00:00 2001 From: alrs Date: Sat, 25 Apr 2020 02:35:22 +0000 Subject: [PATCH] modules/git: fix dropped error (#127) modules/git: fix dropped error Co-authored-by: Lars Lehtonen Reviewed-on: https://gitea.com/gitea/tea/pulls/127 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: Lunny Xiao --- modules/git/auth.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/git/auth.go b/modules/git/auth.go index eab6262..ff47be7 100644 --- a/modules/git/auth.go +++ b/modules/git/auth.go @@ -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