mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Default pull ref to branch of same name
If we defaulted branch.x.remote to "origin", then we should also default branch.x.merge to the obvious choice. Otherwise we can end up in the situation of a push ref without a pull ref, which leads to a rather confusing "Push" header without a "Merge"/"Rebase" header. References: https://github.com/tpope/vim-fugitive/issues/2129
This commit is contained in:
@@ -2823,7 +2823,7 @@ function! fugitive#BufReadStatus(...) abort
|
||||
elseif fetch_remote ==# '.'
|
||||
let pull_ref = FugitiveConfigGet('branch.' . branch . '.merge', config)
|
||||
else
|
||||
let pull_ref = substitute(FugitiveConfigGet('branch.' . branch . '.merge', config), '^refs/heads/', 'refs/remotes/' . fetch_remote . '/', '')
|
||||
let pull_ref = substitute(config.Get('branch.' . branch . '.merge', 'refs/heads/' . branch), '^refs/heads/', 'refs/remotes/' . fetch_remote . '/', '')
|
||||
endif
|
||||
if len(pull_ref)
|
||||
let rebase = FugitiveConfigGet('branch.' . branch . '.rebase', config)
|
||||
|
||||
Reference in New Issue
Block a user