diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index fe7d96e..aa087d9 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -29,8 +29,8 @@ endfunction function! s:shellesc(arg) abort if a:arg =~ '^[A-Za-z0-9_/.-]\+$' return a:arg - elseif &shell =~# 'cmd' && a:arg !~# '"' - return '"'.a:arg.'"' + elseif &shell =~# 'cmd' + return '"'.s:gsub(s:gsub(a:arg, '"', '""'), '\%', '"%"').'"' else return shellescape(a:arg) endif