From 5b41edd383bda0ccf6452d2e9af2bd6570f89b45 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Tue, 24 Jan 2017 21:27:31 +0100 Subject: [PATCH] MergeDlg: Choose upstream tracked branch as default as Git does Signed-off-by: Sven Strickroth --- src/TortoiseProc/MergeDlg.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/TortoiseProc/MergeDlg.cpp b/src/TortoiseProc/MergeDlg.cpp index d93c8433e..29c15113a 100644 --- a/src/TortoiseProc/MergeDlg.cpp +++ b/src/TortoiseProc/MergeDlg.cpp @@ -155,6 +155,18 @@ BOOL CMergeDlg::OnInitDialog() EnableSaveRestore(L"MergeDlg"); GetDlgItem(IDOK)->SetFocus(); + if (m_initialRefName.IsEmpty()) + { + CString currentBranch; + if (g_Git.GetCurrentBranchFromFile(g_Git.m_CurrentDir, currentBranch)) + currentBranch.Empty(); + + CString pr, pb; + g_Git.GetRemotePushBranch(currentBranch, pr, pb); + if (!pr.IsEmpty() && !pb.IsEmpty()) + m_initialRefName = L"remotes/" + pr + L'/' + pb; + } + InitChooseVersion(true); return FALSE; -- 2.11.4.GIT