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.
This commit is contained in:
Tim Pope
2021-08-25 07:35:54 -04:00
parent 74b0960f5b
commit 09d3551627

View File

@@ -2600,10 +2600,12 @@ function! fugitive#BufReadStatus() abort
if push !=# pull if push !=# pull
call s:AddHeader('Push', push) call s:AddHeader('Push', push)
endif endif
if get(fugitive#ConfigGetAll('core.bare', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$' if empty(s:Tree())
call s:AddHeader('Bare', 'yes') if get(fugitive#ConfigGetAll('core.bare', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$'
elseif empty(s:Tree()) call s:AddHeader('Bare', 'yes')
call s:AddHeader('Error', s:worktree_error) else
call s:AddHeader('Error', s:worktree_error)
endif
endif endif
if get(fugitive#ConfigGetAll('advice.statusHints', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$' if get(fugitive#ConfigGetAll('advice.statusHints', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$'
call s:AddHeader('Help', 'g?') call s:AddHeader('Help', 'g?')