Skip to content

Commit

Permalink
git-svn: On MSYS, escape and quote SVN_SSH also if set by the user
Browse files Browse the repository at this point in the history
While GIT_SSH does not require any escaping / quoting (e.g. for paths
containing spaces), SVN_SSH requires it due to its use in a Perl script.

Previously, SVN_SSH has only been escaped and quoted automatically if it
was unset and thus derived from GIT_SSH. For user convenience, do the
escaping and quoting also for a SVN_SSH set by the user. This way, the
user is able to use the same unescaped and unquoted syntax for GIT_SSH
and SVN_SSH.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Sebastian Schuberth authored and Junio C Hamano committed Oct 15, 2011
1 parent 72b5158 commit 184892f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
$Git::SVN::Ra::_log_window_size = 100;
$Git::SVN::_minimize_url = 'unset';

if (! exists $ENV{SVN_SSH}) {
if (exists $ENV{GIT_SSH}) {
$ENV{SVN_SSH} = $ENV{GIT_SSH};
if ($^O eq 'msys') {
$ENV{SVN_SSH} =~ s/\\/\\\\/g;
$ENV{SVN_SSH} =~ s/(.*)/"$1"/;
}
}
if (! exists $ENV{SVN_SSH} && exists $ENV{GIT_SSH}) {
$ENV{SVN_SSH} = $ENV{GIT_SSH};
}

if (exists $ENV{SVN_SSH} && $^O eq 'msys') {
$ENV{SVN_SSH} =~ s/\\/\\\\/g;
$ENV{SVN_SSH} =~ s/(.*)/"$1"/;
}

$Git::SVN::Log::TZ = $ENV{TZ};
Expand Down

0 comments on commit 184892f

Please sign in to comment.