mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 21:33:53 -05:00
Use jobs for FileReadCmd
This commit is contained in:
@@ -2464,11 +2464,18 @@ function! fugitive#FileReadCmd(...) abort
|
||||
return 'noautocmd ' . line . 'read ' . s:fnameescape(amatch)
|
||||
endif
|
||||
if rev !~# ':' && s:ChompDefault('', [dir, 'cat-file', '-t', rev]) =~# '^\%(commit\|tag\)$'
|
||||
let cmd = fugitive#ShellCommand([dir, 'log', '--pretty=format:%B', '-1', rev, '--'])
|
||||
let cmd = [dir, 'log', '--pretty=format:%B', '-1', rev, '--']
|
||||
else
|
||||
let cmd = fugitive#ShellCommand([dir, 'cat-file', '-p', rev, '--'])
|
||||
let cmd = [dir, 'cat-file', '-p', rev, '--']
|
||||
endif
|
||||
let temp = tempname()
|
||||
let [err, exec_error] = s:StdoutToFile(temp, cmd)
|
||||
if exec_error
|
||||
call delete(temp)
|
||||
return 'noautocmd ' . line . 'read ' . s:fnameescape(amatch)
|
||||
else
|
||||
return 'silent keepalt ' . line . 'read ' . s:fnameescape(temp) . '|call delete(' . string(temp) . ')'
|
||||
endif
|
||||
return line . 'read !' . escape(cmd, '!#%')
|
||||
endfunction
|
||||
|
||||
function! fugitive#FileWriteCmd(...) abort
|
||||
|
||||
Reference in New Issue
Block a user