From 3121f01f5910200cbb2c88b782eef264b5347d25 Mon Sep 17 00:00:00 2001 From: Michael Geddes Date: Thu, 3 Jun 2010 10:42:41 +0800 Subject: [PATCH] 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 --- plugin/fugitive.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index d272ffc..4d56133 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1431,7 +1431,11 @@ function! s:BufWriteIndexFile() endif let info = old_mode.' '.sha1.' '.stage."\t".path call writefile([info],tmp) - let error = system(s:repo().git_command('update-index','--index-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) + endif if v:shell_error == 0 setlocal nomodified silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p'))