1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 21:07:52 +01:00

perl/Git.pm: Honor SSH_ASKPASS as fallback if GIT_ASKPASS is not set

If GIT_ASKPASS environment variable is not set, git-svn does not try to use
SSH_ASKPASS as git-core does. This change adds a fallback to SSH_ASKPASS.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Sven Strickroth 2012-12-18 01:28:47 +01:00 committed by Junio C Hamano
parent 38ecf3a35d
commit 8f3cab2b4d

View file

@ -515,8 +515,8 @@ sub version {
Query user C<PROMPT> and return answer from user. Query user C<PROMPT> and return answer from user.
Honours GIT_ASKPASS environment variable for querying Honours GIT_ASKPASS and SSH_ASKPASS environment variables for querying
the user. If no GIT_ASKPASS variable is set or an error occoured, the user. If no *_ASKPASS variable is set or an error occoured,
the terminal is tried as a fallback. the terminal is tried as a fallback.
=cut =cut
@ -527,6 +527,9 @@ sub prompt {
if (exists $ENV{'GIT_ASKPASS'}) { if (exists $ENV{'GIT_ASKPASS'}) {
$ret = _prompt($ENV{'GIT_ASKPASS'}, $prompt); $ret = _prompt($ENV{'GIT_ASKPASS'}, $prompt);
} }
if (!defined $ret && exists $ENV{'SSH_ASKPASS'}) {
$ret = _prompt($ENV{'SSH_ASKPASS'}, $prompt);
}
if (!defined $ret) { if (!defined $ret) {
print STDERR $prompt; print STDERR $prompt;
STDERR->flush; STDERR->flush;