Skip to content

Commit 13fdeb5

Browse files
committed
Don't show bogus unstaged changes in bare repository
References #1262
1 parent 3936a74 commit 13fdeb5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

autoload/fugitive.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,10 @@ function! fugitive#BufReadStatus() abort
17241724
endwhile
17251725
endif
17261726

1727+
if empty(s:Tree())
1728+
let [unstaged, untracked] = [[], []]
1729+
endif
1730+
17271731
for dict in staged
17281732
let b:fugitive_files['Staged'][dict.filename] = dict
17291733
endfor
@@ -1820,6 +1824,9 @@ function! fugitive#BufReadStatus() abort
18201824
if push !=# pull
18211825
call s:AddHeader('Push', push)
18221826
endif
1827+
if empty(s:Tree())
1828+
call s:AddHeader('Bare', 'yes')
1829+
endif
18231830
call s:AddSection('Rebasing ' . rebasing_head, rebasing)
18241831
call s:AddSection('Untracked', untracked)
18251832
call s:AddSection('Unstaged', unstaged)

0 commit comments

Comments
 (0)