Work around new status style in 1.8.5

Closes #393.
This commit is contained in:
Tim Pope
2013-10-24 00:16:15 -04:00
parent dc250fcc8d
commit 34e2d2538a

View File

@@ -2068,9 +2068,17 @@ function! s:BufReadIndex()
else else
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let dir = getcwd() let dir = getcwd()
if fugitive#git_version() =~# '^0\|1\.[1-7]\.'
let cmd = s:repo().git_command('status')
else
let cmd = s:repo().git_command(
\ '-c', 'status.displayCommentPrefix=true',
\ '-c', 'color.status=false',
\ 'status')
endif
try try
execute cd.'`=s:repo().tree()`' execute cd.'`=s:repo().tree()`'
call s:ReplaceCmd(s:repo().git_command('status'),index) call s:ReplaceCmd(cmd, index)
finally finally
execute cd.'`=dir`' execute cd.'`=dir`'
endtry endtry