summaryrefslogtreecommitdiff
path: root/perl/Git.pm
diff options
context:
space:
mode:
authorSven Strickroth <sven.strickroth@tu-clausthal.de>2012-12-18 00:28:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-12-18 01:21:24 (GMT)
commit8f3cab2b4d7b6da8b69eea730e5774dcb208c50f (patch)
treeac8ecd7f22fb9b153652ebe152660d8ba81d29ba /perl/Git.pm
parent38ecf3a35d4255368a24ca255daf0b1ea433f1e3 (diff)
downloadgit-8f3cab2b4d7b6da8b69eea730e5774dcb208c50f.zip
git-8f3cab2b4d7b6da8b69eea730e5774dcb208c50f.tar.gz
git-8f3cab2b4d7b6da8b69eea730e5774dcb208c50f.tar.bz2
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>
Diffstat (limited to 'perl/Git.pm')
-rw-r--r--perl/Git.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index 72e93c7..8dfca65 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -515,8 +515,8 @@ sub html_path { command_oneline('--html-path') }
Query user C<PROMPT> and return answer from user.
-Honours GIT_ASKPASS environment variable for querying
-the user. If no GIT_ASKPASS variable is set or an error occoured,
+Honours GIT_ASKPASS and SSH_ASKPASS environment variables for querying
+the user. If no *_ASKPASS variable is set or an error occoured,
the terminal is tried as a fallback.
=cut
@@ -527,6 +527,9 @@ sub prompt {
if (exists $ENV{'GIT_ASKPASS'}) {
$ret = _prompt($ENV{'GIT_ASKPASS'}, $prompt);
}
+ if (!defined $ret && exists $ENV{'SSH_ASKPASS'}) {
+ $ret = _prompt($ENV{'SSH_ASKPASS'}, $prompt);
+ }
if (!defined $ret) {
print STDERR $prompt;
STDERR->flush;