\r
Refresh();\r
\r
- m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));\r
- m_BranchRemote.SetCurSel(0);\r
\r
//m_BranchRemote.SetWindowTextW(m_BranchSource.GetString());\r
\r
m_RemoteReg = remote;\r
int sel=0;\r
\r
+ CString currentBranch = g_Git.GetSymbolicRef();\r
+ CString configName;\r
+\r
+ configName.Format(L"branch.%s.pushremote", currentBranch);\r
+ CString pushRemote = g_Git.GetConfigValue(configName);\r
+ if( pushRemote.IsEmpty() )\r
+ {\r
+ configName.Format(L"branch.%s.remote", currentBranch);\r
+ pushRemote = g_Git.GetConfigValue(configName);\r
+ }\r
+\r
+ if( !pushRemote.IsEmpty() )\r
+ remote=pushRemote;\r
+\r
+ //Select pull-branch from current branch\r
+ configName.Format(L"branch.%s.pushbranch", currentBranch);\r
+ CString pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));\r
+ if( pushBranch.IsEmpty() )\r
+ {\r
+ configName.Format(L"branch.%s.merge", currentBranch);\r
+ pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName)); \r
+ }\r
+\r
STRING_VECTOR list;\r
m_Remote.Reset();\r
\r
}\r
m_BranchSource.SetCurSel(current);\r
\r
+ m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));\r
+ if( !pushBranch.IsEmpty() )\r
+ m_BranchRemote.AddString(pushBranch);\r
+\r
+ m_BranchRemote.SetCurSel(0);\r
+\r
}\r
// CPushDlg message handlers\r
\r