Don't throw exception on :Gedit :bogus

This commit is contained in:
Tim Pope 2019-07-05 10:32:17 -04:00
parent ef820b7577
commit 0f46d5ce32

View File

@ -1721,9 +1721,9 @@ function! fugitive#BufReadCmd(...) abort
else
let [b:fugitive_type, exec_error] = s:ChompError([dir, 'cat-file', '-t', rev])
if exec_error && rev =~# '^:0'
let sha = s:TreeChomp(dir, 'write-tree', '--prefix=' . rev[3:-1])
let exec_error = 0
let b:fugitive_type = 'tree'
let sha = s:ChompDefault('', dir, 'write-tree', '--prefix=' . rev[3:-1])
let exec_error = empty(sha)
let b:fugitive_type = exec_error ? '' : 'tree'
endif
if exec_error
let error = b:fugitive_type