Don't show "Unpushed to *" if no remotes

If there are no remotes, then this section will always contain the
entire branch history, or a truncated version thereof.  I want all
sections to be meaningfully bounded.
This commit is contained in:
Tim Pope
2023-03-01 19:45:04 -05:00
parent fa33145cc1
commit 891b0a92fe

View File

@@ -2906,7 +2906,8 @@ function! fugitive#BufReadStatus(...) abort
if len(pull) && push !=# pull
call s:AddLogSection('Unpushed to ' . pull, [pull . '..' . head])
endif
if empty(pull) && empty(push) && empty(rebasing)
if empty(pull) && empty(push) && empty(rebasing) &&
\ !empty(fugitive#ConfigGetRegexp('^remote\..*\.url$', config))
call s:AddLogSection('Unpushed to *', [head, '--not', '--remotes'])
endif
if len(push) && push !=# pull