{"thread":{"id":"28584","subject":"[PATCH] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user","startedAt":"2011-10-05T09:14:38Z","lastAt":"2011-10-05T09:14:38Z","messageCount":1,"participants":["Sebastian Schuberth"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"176915","messageId":"4E8C1FFE.3010605@gmail.com","threadId":"28584","inReplyTo":null,"subject":"[PATCH] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2011-10-05T09:14:38Z","receivedAt":"2011-10-05T09:14:38Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"While GIT_SSH does not require any escaping / quoting (e.g. for paths\ncontaining spaces), SVN_SSH requires it due to its use in a Perl script.\n\nPreviously, SVN_SSH has only been escaped and quoted automatically if it\nwas unset and thus derived from GIT_SSH. For user convenience, do the\nescaping and quoting also for a SVN_SSH set by the user. This way, the\nuser is able to use the same unescaped and unquoted syntax for GIT_SSH\nand SVN_SSH.\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n git-svn.perl |   15 +++++++--------\n 1 files changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 89f83fd..c3b4b58 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -22,14 +22,13 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';\n $Git::SVN::Ra::_log_window_size = 100;\n $Git::SVN::_minimize_url = 'unset';\n \n-if (! exists $ENV{SVN_SSH}) {\n-\tif (exists $ENV{GIT_SSH}) {\n-\t\t$ENV{SVN_SSH} = $ENV{GIT_SSH};\n-\t\tif ($^O eq 'msys') {\n-\t\t\t$ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g;\n-\t\t\t$ENV{SVN_SSH} =~ s/(.*)/\"$1\"/;\n-\t\t}\n-\t}\n+if (! exists $ENV{SVN_SSH} && exists $ENV{GIT_SSH}) {\n+\t$ENV{SVN_SSH} = $ENV{GIT_SSH};\n+}\n+\n+if (exists $ENV{SVN_SSH} && $^O eq 'msys') {\n+\t$ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g;\n+\t$ENV{SVN_SSH} =~ s/(.*)/\"$1\"/;\n }\n \n $Git::SVN::Log::TZ = $ENV{TZ};\n-- \n1.7.6.GIT\n"}]}