From 279d56eb478abf0741188f1dad872b5f7fc8e18e Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 25 Jan 2020 21:13:00 -0500 Subject: [PATCH] Show unpulled before unpushed This is what Magit does and I *think* it makes sense because you have to pull before you can push. --- autoload/fugitive.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 0dec105..721d448 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1884,17 +1884,17 @@ function! fugitive#BufReadStatus() abort call s:AddSection('Staged', staged) let staged_end = len(staged) ? line('$') : 0 - if len(push) && !(push ==# pull && get(props, 'branch.ab') =~# '^+0 ') - call s:AddSection('Unpushed to ' . push, s:QueryLog(push . '..' . head)) - endif - if len(pull) && push !=# pull - call s:AddSection('Unpushed to ' . pull, s:QueryLog(pull . '..' . head)) + if len(pull) && get(props, 'branch.ab') !~# ' -0$' + call s:AddSection('Unpulled from ' . pull, s:QueryLog(head . '..' . pull)) endif if len(push) && push !=# pull call s:AddSection('Unpulled from ' . push, s:QueryLog(head . '..' . push)) endif - if len(pull) && get(props, 'branch.ab') !~# ' -0$' - call s:AddSection('Unpulled from ' . pull, s:QueryLog(head . '..' . pull)) + if len(pull) && push !=# pull + call s:AddSection('Unpushed to ' . pull, s:QueryLog(pull . '..' . head)) + endif + if len(push) && !(push ==# pull && get(props, 'branch.ab') =~# '^+0 ') + call s:AddSection('Unpushed to ' . push, s:QueryLog(push . '..' . head)) endif setlocal nomodified readonly noswapfile