Fix :Gread blobhash

References https://github.com/tpope/vim-fugitive/issues/836
This commit is contained in:
Tim Pope 2019-08-08 18:15:26 -04:00
parent 9d36dc2d74
commit 1260de3b7d

View File

@ -1886,7 +1886,7 @@ function! fugitive#FileReadCmd(...) abort
if empty(dir)
return 'noautocmd ' . line . 'read ' . s:fnameescape(amatch)
endif
if rev !~# ':'
if rev !~# ':' && s:ChompDefault('', [dir, 'cat-file', '-t', rev]) =~# '^\%(commit\|tag\)$'
let cmd = fugitive#Prepare(dir, 'log', '--pretty=format:%B', '-1', rev, '--')
else
let cmd = fugitive#Prepare(dir, 'cat-file', '-p', rev)