From 944dc602c65a3f9e0e595dde6234a5e082230dd2 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 11 Jan 2022 13:33:28 -0500 Subject: [PATCH] Require core.bare=true for bare repositories Resolves: https://github.com/tpope/vim-fugitive/issues/1920 --- autoload/fugitive.vim | 2 +- plugin/fugitive.vim | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index c46784a..87d57c4 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2816,7 +2816,7 @@ function! fugitive#BufReadStatus(...) abort call s:AddHeader('Push', push) endif if empty(s:Tree()) - if get(fugitive#ConfigGetAll('core.bare', config), 0, 'true') !~# '^\%(false\|no|off\|0\|\)$' + if get(fugitive#ConfigGetAll('core.bare', config), 0, '') !~# '^\%(false\|no|off\|0\|\)$' call s:AddHeader('Bare', 'yes') else call s:AddHeader('Error', s:worktree_error) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 7d0836e..c24d33a 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -327,8 +327,8 @@ function! s:Tree(path) abort if len(wt_config) == 1 let worktree = FugitiveVimPath(matchstr(wt_config[0], '= *\zs.*')) else - call filter(config,'v:val =~# "^\\s*bare *= *false *$"') - if len(config) + call filter(config,'v:val =~# "^\\s*bare *= *true *$"') + if empty(config) let s:worktree_for_dir[dir] = 0 endif endif