Make unrecognized git type error more informative

This commit is contained in:
Tim Pope 2017-04-02 17:04:02 -04:00
parent 87c1bda4d5
commit 90cbbf5854

View File

@ -2662,7 +2662,7 @@ function! s:BufReadObject() abort
let b:fugitive_type = s:repo().git_chomp('cat-file','-t',hash) let b:fugitive_type = s:repo().git_chomp('cat-file','-t',hash)
endif endif
if b:fugitive_type !~# '^\%(tag\|commit\|tree\|blob\)$' if b:fugitive_type !~# '^\%(tag\|commit\|tree\|blob\)$'
return "echoerr 'fugitive: unrecognized git type'" return "echoerr ".string("fugitive: unrecognized git type '".b:fugitive_type."'")
endif endif
let firstline = getline('.') let firstline = getline('.')
if !exists('b:fugitive_display_format') && b:fugitive_type != 'blob' if !exists('b:fugitive_display_format') && b:fugitive_type != 'blob'