t4202 (log): Replace '<git-command> || :' with test_might_fail
[gitweb.git] / connect.c
index e296bfca1896b432376ea98cf92db46d7120a062..57dc20c43ca1ba205ec0a18e263f9dde081390f4 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -629,9 +629,14 @@ char *git_getpass(const char *prompt)
        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;