motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit 13fdeb5fa7f464266163f405f42322e6fb0d3067 (tree)
parent 3936a74584b4a5bfae99630dffe3d7024011b9e9
Author: Tim Pope <code@tpope.net>
Date:   Sun, 17 Nov 2019 22:17:34 -0500

Don't show bogus unstaged changes in bare repository

References https://github.com/tpope/vim-fugitive/pull/1262

Diffstat:
Mautoload/fugitive.vim | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim @@ -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)