commit 09d3551627c3b2c8c7a985fb8b05fca4e1bf7422 (tree)
parent 74b0960f5b222db694058991189a2beb9b943da0
Author: Tim Pope <code@tpope.net>
Date: Wed, 25 Aug 2021 07:35:54 -0400
Don't show "Bare" status for worktrees attached to bare repos
I tried to make this foolproof and once again someone has invented a
bigger fool.
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -2600,10 +2600,12 @@ function! fugitive#BufReadStatus() abort
if push !=# pull
call s:AddHeader('Push', push)
endif
- if get(fugitive#ConfigGetAll('core.bare', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$'
- call s:AddHeader('Bare', 'yes')
- elseif empty(s:Tree())
- call s:AddHeader('Error', s:worktree_error)
+ if empty(s:Tree())
+ if get(fugitive#ConfigGetAll('core.bare', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$'
+ call s:AddHeader('Bare', 'yes')
+ else
+ call s:AddHeader('Error', s:worktree_error)
+ endif
endif
if get(fugitive#ConfigGetAll('advice.statusHints', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$'
call s:AddHeader('Help', 'g?')