Show error getting type for object in BufReadCmd

This commit is contained in:
Tim Pope 2018-09-15 16:47:20 -04:00
parent 02fe20ece4
commit fb55319973

View File

@ -1440,13 +1440,14 @@ function! fugitive#BufReadCmd(...) abort
let b:fugitive_type = 'tree'
endif
if v:shell_error
let error = b:fugitive_type
unlet b:fugitive_type
if rev =~# '^:\d:'
let &readonly = !filewritable(dir . '/index')
return 'silent doautocmd BufNewFile '.s:fnameescape(amatch)
else
setlocal readonly nomodifiable
return ''
return 'echo ' . string(error)
endif
elseif b:fugitive_type !~# '^\%(tag\|commit\|tree\|blob\)$'
return "echoerr ".string("fugitive: unrecognized git type '".b:fugitive_type."'")