From cba863444c9e970bc7282f76df0f559b5fc830bd Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 5 Apr 2022 12:11:10 -0400 Subject: [PATCH] Move unpushed sections above unpulled, again This reverts commit 279d56eb478abf0741188f1dad872b5f7fc8e18e (effectively). References: https://github.com/tpope/vim-fugitive/issues/1963 --- autoload/fugitive.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 40d07d1..fe792b3 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2845,17 +2845,17 @@ function! fugitive#BufReadStatus(...) abort call s:AddSection('Staged', staged) let staged_end = len(staged) ? line('$') : 0 - if len(pull) && get(props, 'branch.ab') !~# ' -0$' - call s:AddLogSection('Unpulled from ' . pull, head, pull) - endif - if len(push) && push !=# pull - call s:AddLogSection('Unpulled from ' . push, head, push) + if len(push) && !(push ==# pull && get(props, 'branch.ab') =~# '^+0 ') + call s:AddLogSection('Unpushed to ' . push, push, head) endif if len(pull) && push !=# pull call s:AddLogSection('Unpushed to ' . pull, pull, head) endif - if len(push) && !(push ==# pull && get(props, 'branch.ab') =~# '^+0 ') - call s:AddLogSection('Unpushed to ' . push, push, head) + if len(push) && push !=# pull + call s:AddLogSection('Unpulled from ' . push, head, push) + endif + if len(pull) && get(props, 'branch.ab') !~# ' -0$' + call s:AddLogSection('Unpulled from ' . pull, head, pull) endif setlocal nomodified readonly noswapfile