Skip to content

Commit 2578040

Browse files
Escape with double quotes instead of single
1 parent ea0a1f9 commit 2578040

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/git/lib.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,8 @@ def run_command(git_cmd, &block)
711711
end
712712

713713
def escape(s)
714-
"'" + s.to_s.gsub('\'', '\'\\\'\'') + "'"
714+
escaped = s.to_s.gsub('\'', '\'\\\'\'')
715+
%Q{"#{escaped}"}
715716
end
716717

717718
end

0 commit comments

Comments
 (0)