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>

Sven Strickroth committed Dec 18, 2012 at 01:28 UTC 8f3cab2b4d7b6da8b69eea730e5774dcb208c50f
1 file changed +5 -2
perl/Git.pm
+5 -2
@@ -515,8 +515,8 @@ sub html_path { command_oneline('--html-path') }
515
516 Query user C<PROMPT> and return answer from user.
517
518 -Honours GIT_ASKPASS environment variable for querying
519 -the user. If no GIT_ASKPASS variable is set or an error occoured,
518 +Honours GIT_ASKPASS and SSH_ASKPASS environment variables for querying
519 +the user. If no *_ASKPASS variable is set or an error occoured,
520 the terminal is tried as a fallback.
521
522 =cut
@@ -527,6 +527,9 @@ sub prompt {
527 if (exists $ENV{'GIT_ASKPASS'}) {
528 $ret = _prompt($ENV{'GIT_ASKPASS'}, $prompt);
529 }
530 + if (!defined $ret && exists $ENV{'SSH_ASKPASS'}) {
531 + $ret = _prompt($ENV{'SSH_ASKPASS'}, $prompt);
532 + }
533 if (!defined $ret) {
534 print STDERR $prompt;
535 STDERR->flush;