We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c47ccb6 commit b6f1b45Copy full SHA for b6f1b45
lib/git/lib.rb
@@ -1077,7 +1077,10 @@ def run_command(git_cmd, &block)
1077
end
1078
1079
def escape(s)
1080
- return "'#{s && s.to_s.gsub('\'','\'"\'"\'')}'" if RUBY_PLATFORM !~ /mingw|mswin/
+ # Check if on Windows via RUBY_PLATFORM (CRuby) and RUBY_DESCRIPTION (JRuby)
1081
+ win_platform_regex = /mingw|mswin/
1082
+ return "'#{s && s.to_s.gsub('\'','\'"\'"\'')}'" if RUBY_PLATFORM !~ win_platform_regex && RUBY_DESCRIPTION !~ win_platform_regex
1083
+
1084
1085
# Keeping the old escape format for windows users
1086
escaped = s.to_s.gsub('\'', '\'\\\'\'')
0 commit comments