diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 84ae2d0..f334e36 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1652,7 +1652,11 @@ function! s:ReplaceCmd(cmd,...) abort let prefix = 'env GIT_INDEX_FILE='.s:shellesc(a:1).' ' endif endif - call writefile(split(system(prefix.a:cmd), "\n", 1), tmp, 'b') + if &shell =~# 'cmd' + call system('cmd /c "'.prefix.a:cmd.' > '.tmp.'"') + else + call system(' ('.prefix.a:cmd.' > '.tmp.') ') + endif finally if exists('old_index') let $GIT_INDEX_FILE = old_index