Skip to content

Commit 8f3cab2

Browse files
Sven Strickrothgitster
authored andcommitted
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 protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 38ecf3a commit 8f3cab2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

perl/Git.pm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ sub html_path { command_oneline('--html-path') }
515515
516516
Query user C<PROMPT> and return answer from user.
517517
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,
520520
the terminal is tried as a fallback.
521521
522522
=cut
@@ -527,6 +527,9 @@ sub prompt {
527527
if (exists $ENV{'GIT_ASKPASS'}) {
528528
$ret = _prompt($ENV{'GIT_ASKPASS'}, $prompt);
529529
}
530+
if (!defined $ret && exists $ENV{'SSH_ASKPASS'}) {
531+
$ret = _prompt($ENV{'SSH_ASKPASS'}, $prompt);
532+
}
530533
if (!defined $ret) {
531534
print STDERR $prompt;
532535
STDERR->flush;

0 commit comments

Comments
 (0)