From 0f46d5ce3243502b60780b536b1e8ff103590e83 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 5 Jul 2019 10:32:17 -0400 Subject: [PATCH] Don't throw exception on :Gedit :bogus --- autoload/fugitive.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 253e5a0..6163a95 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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