Don't show bogus unstaged changes in bare repository

References https://github.com/tpope/vim-fugitive/pull/1262
This commit is contained in:
Tim Pope
2019-11-17 22:17:34 -05:00
parent 3936a74584
commit 13fdeb5fa7

View File

@@ -1724,6 +1724,10 @@ function! fugitive#BufReadStatus() abort
endwhile
endif
if empty(s:Tree())
let [unstaged, untracked] = [[], []]
endif
for dict in staged
let b:fugitive_files['Staged'][dict.filename] = dict
endfor
@@ -1820,6 +1824,9 @@ function! fugitive#BufReadStatus() abort
if push !=# pull
call s:AddHeader('Push', push)
endif
if empty(s:Tree())
call s:AddHeader('Bare', 'yes')
endif
call s:AddSection('Rebasing ' . rebasing_head, rebasing)
call s:AddSection('Untracked', untracked)
call s:AddSection('Unstaged', unstaged)