Support core.autocrlf=false on Windows

Fixes #99.
This commit is contained in:
Tim Pope 2011-08-09 00:59:38 -04:00
parent a0f5c0445e
commit 78b405fd52

View File

@ -1652,7 +1652,11 @@ function! s:ReplaceCmd(cmd,...) abort
let prefix = 'env GIT_INDEX_FILE='.s:shellesc(a:1).' ' let prefix = 'env GIT_INDEX_FILE='.s:shellesc(a:1).' '
endif endif
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 finally
if exists('old_index') if exists('old_index')
let $GIT_INDEX_FILE = old_index let $GIT_INDEX_FILE = old_index