git-svn: On MSYS, escape and quote SVN_SSH also if set by the user
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>
Sebastian Schuberth committed
Oct 14, 2011 at 23:53 UTC
184892fb3e19cd28aaced4ca185257ed5b3acc78
1 file changed
+7
-8
git-svn.perl
+7
-8
@@ -22,14 +22,13 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
22
$Git::SVN::Ra::_log_window_size = 100;
23
$Git::SVN::_minimize_url = 'unset';
24
25
-if (! exists $ENV{SVN_SSH}) {
26
- if (exists $ENV{GIT_SSH}) {
27
- $ENV{SVN_SSH} = $ENV{GIT_SSH};
28
- if ($^O eq 'msys') {
29
- $ENV{SVN_SSH} =~ s/\\/\\\\/g;
30
- $ENV{SVN_SSH} =~ s/(.*)/"$1"/;
31
- }
32
- }
25
+if (! exists $ENV{SVN_SSH} && exists $ENV{GIT_SSH}) {
26
+ $ENV{SVN_SSH} = $ENV{GIT_SSH};
27
+}
28
+
29
+if (exists $ENV{SVN_SSH} && $^O eq 'msys') {
30
+ $ENV{SVN_SSH} =~ s/\\/\\\\/g;
31
+ $ENV{SVN_SSH} =~ s/(.*)/"$1"/;
32
}
33
34
$Git::SVN::Log::TZ = $ENV{TZ};