Allow applying from git diffs to work under win32.

The introduction of using 'chcp' in the git.cmd wrapper was causing the
piped in values to be gobbled by the chcp in the call to update-index.

Signed-off-by: Michael Geddes <vimmer@frog.wheelycreek.net>
This commit is contained in:
Michael Geddes
2010-06-03 10:42:41 +08:00
committed by Tim Pope
parent ffcc12de5f
commit 3121f01f59

View File

@@ -1431,7 +1431,11 @@ function! s:BufWriteIndexFile()
endif endif
let info = old_mode.' '.sha1.' '.stage."\t".path let info = old_mode.' '.sha1.' '.stage."\t".path
call writefile([info],tmp) call writefile([info],tmp)
if has('win32')
let error = system('type '.tmp.'|'.s:repo().git_command('update-index','--index-info'))
else
let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp) let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp)
endif
if v:shell_error == 0 if v:shell_error == 0
setlocal nomodified setlocal nomodified
silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p')) silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p'))