From 09d3551627c3b2c8c7a985fb8b05fca4e1bf7422 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 25 Aug 2021 07:35:54 -0400 Subject: [PATCH] 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. --- autoload/fugitive.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 7855a51..5a72bf9 100644 --- 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?')