Skip to content

Commit 90e87b0

Browse files
Knut Frankegitster
authored andcommitted
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>
1 parent d3e7da8 commit 90e87b0

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

connect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ char *git_getpass(const char *prompt)
629629
askpass = getenv("GIT_ASKPASS");
630630
if (!askpass)
631631
askpass = askpass_program;
632-
632+
if (!askpass)
633+
askpass = getenv("SSH_ASKPASS");
633634
if (!askpass || !(*askpass))
634635
return getpass(prompt);
635636

git.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
5555
{
5656
int handled = 0;
5757

58-
if (!getenv("GIT_ASKPASS") && getenv("SSH_ASKPASS"))
59-
setenv("GIT_ASKPASS", getenv("SSH_ASKPASS"), 1);
60-
6158
while (*argc > 0) {
6259
const char *cmd = (*argv)[0];
6360
if (cmd[0] != '-')

0 commit comments

Comments
 (0)