diff --git a/lib/git/lib.rb b/lib/git/lib.rb index d892462a..2d6c129d 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -1191,8 +1191,9 @@ def escape_for_sh(s) end def escape_for_windows(s) - # Windows does not need single quote escaping inside double quotes - %Q{"#{s}"} + # Escape existing double quotes in s and then wrap the result with double quotes + escaped_string = s.to_s.gsub('"','\\"') + %Q{"#{escaped_string}"} end def windows_platform?