@matheusbsbs / matheus-bagliano / commits / 90e87b017f
Fork 0

Allow core.askpass to override SSH_ASKPASS.

Modify handling of the 'core.askpass' option so that it has the same effect as GIT_ASKPASS also if SSH_ASKPASS is set. Signed-off-by: Knut Franke <k.franke@science-computing.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Knut Franke committed Aug 30, 2010 at 15:39 UTC 90e87b017f93fc606e2d6956766b32e56b4a9a2e
2 files changed +2 -4
connect.c
+2 -1
@@ -629,7 +629,8 @@ char *git_getpass(const char *prompt)
629 askpass = getenv("GIT_ASKPASS");
630 if (!askpass)
631 askpass = askpass_program;
632 -
632 + if (!askpass)
633 + askpass = getenv("SSH_ASKPASS");
634 if (!askpass || !(*askpass))
635 return getpass(prompt);
636
git.c
-3
@@ -55,9 +55,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
55 {
56 int handled = 0;
57
58 - if (!getenv("GIT_ASKPASS") && getenv("SSH_ASKPASS"))
59 - setenv("GIT_ASKPASS", getenv("SSH_ASKPASS"), 1);
60 -
58 while (*argc > 0) {
59 const char *cmd = (*argv)[0];
60 if (cmd[0] != '-')