From 78b405fd5291add609cafc8efb1058ab5e223cda Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 9 Aug 2011 00:59:38 -0400 Subject: [PATCH] Support core.autocrlf=false on Windows Fixes #99. --- plugin/fugitive.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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