Partially support :Git difftool on old Git

This commit is contained in:
Tim Pope
2020-02-05 15:41:08 -05:00
parent 98f67310aa
commit 9f69019424

View File

@@ -3841,7 +3841,11 @@ function! s:ToolStream(line1, line2, range, bang, mods, options, args, state) ab
let a:state.mode = 'init' let a:state.mode = 'init'
let a:state.from = '' let a:state.from = ''
let a:state.to = '' let a:state.to = ''
let exec = s:UserCommandList({'git': a:options.git, 'dir': a:options.dir}) + ['-c', 'diff.context=0'] + a:options.flags + ['--no-pager', 'diff', '--no-ext-diff', '--no-color', '--no-prefix'] + argv let exec = s:UserCommandList({'git': a:options.git, 'dir': a:options.dir})
if fugitive#GitVersion(1, 9) || (!s:HasOpt(argv, '--name-status') && !prompt)
let exec += ['-c', 'diff.context=0']
endif
let exec += a:options.flags + ['--no-pager', 'diff', '--no-ext-diff', '--no-color', '--no-prefix'] + argv
if prompt if prompt
let title = ':Git ' . s:fnameescape(a:options.flags + [a:options.command] + a:options.args) let title = ':Git ' . s:fnameescape(a:options.flags + [a:options.command] + a:options.args)
return s:QuickfixStream(a:line2, 'difftool', title, exec, !a:bang, s:function('s:ToolParse'), a:state) return s:QuickfixStream(a:line2, 'difftool', title, exec, !a:bang, s:function('s:ToolParse'), a:state)