From f75dbb19672b590fe8e32334051314b47e91ae02 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 7 Mar 2023 14:45:05 -0500 Subject: [PATCH] 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 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index eb4b103..1f16342 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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)