m_UpstreamCtrl.AddString(m_Upstream);\r
m_UpstreamCtrl.SetCurSel(m_UpstreamCtrl.GetCount()-1);\r
}\r
+ else\r
+ {\r
+ //Select pull-remote from current branch\r
+ CString currentBranch = g_Git.GetSymbolicRef();\r
+ CString configName;\r
+ configName.Format(L"branch.%s.remote", currentBranch);\r
+ CString pullRemote = g_Git.GetConfigValue(configName);\r
+\r
+ //Select pull-branch from current branch\r
+ configName.Format(L"branch.%s.merge", currentBranch);\r
+ CString pullBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));\r
+\r
+ CString defaultUpstream;\r
+ defaultUpstream.Format(L"remotes/%s/%s", pullRemote, pullBranch);\r
+ int found = m_UpstreamCtrl.FindStringExact(0, defaultUpstream);\r
+ if(found >= 0)\r
+ m_UpstreamCtrl.SetCurSel(found);\r
+ }\r
}\r
\r
void CRebaseDlg::OnCbnSelchangeBranch()\r