Provide default merge head for "." remote

Almost included this in f75dbb1967, but
dropped it because it always equal to the current branch, guaranteeing
an empty log, and because unlike the "origin" default, it shouldn't
really happen in practice.  However if a user screws up their config in
a way that forces it to happen, we should still try to avoid the same
"Push" header issue.
This commit is contained in:
Tim Pope
2023-03-09 14:07:17 -05:00
parent d4941aec93
commit 5b52a0f395

View File

@@ -2817,7 +2817,7 @@ function! fugitive#BufReadStatus(...) abort
if empty(fetch_remote) || empty(branch)
let pull_ref = ''
elseif fetch_remote ==# '.'
let pull_ref = FugitiveConfigGet('branch.' . branch . '.merge', config)
let pull_ref = config.Get('branch.' . branch . '.merge', 'refs/heads/' . branch)
else
let pull_ref = substitute(config.Get('branch.' . branch . '.merge', 'refs/heads/' . branch), '^refs/heads/', 'refs/remotes/' . fetch_remote . '/', '')
endif