askpass = getenv("GIT_ASKPASS");
if (!askpass)
askpass = askpass_program;
-
- if (!askpass || !(*askpass))
- return getpass(prompt);
+ if (!askpass)
+ askpass = getenv("SSH_ASKPASS");
+ if (!askpass || !(*askpass)) {
+ char *result = getpass(prompt);
+ if (!result)
+ die_errno("Could not read password");
+ return result;
+ }
args[0] = askpass;
args[1] = prompt;