Skip to content

Commit

Permalink
Don't show bogus unstaged changes in bare repository
Browse files Browse the repository at this point in the history
References #1262
  • Loading branch information
tpope committed Nov 18, 2019
1 parent 3936a74 commit 13fdeb5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 13fdeb5

Please sign in to comment.