CString currentBranch = g_Git.GetSymbolicRef();\r
CString configName;\r
configName.Format(L"branch.%s.remote", currentBranch);\r
- CString pullRemote = g_Git.GetConfigValue(configName);\r
+ CString pullRemote = m_configPullRemote = 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
+ CString pullBranch = m_configPullBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));\r
m_RemoteBranch.AddString(pullBranch);\r
\r
if(pullRemote.IsEmpty())\r
if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_REMOTE_RD)\r
{\r
m_RemoteURL=m_Remote.GetString();\r
- if(!m_IsPull)\r
+ if( !m_IsPull ||\r
+ (m_configPullRemote == m_RemoteURL && m_configPullBranch == m_RemoteBranch.GetString() ))\r
+ //When fetching or when pulling from the configured tracking branch, dont explicitly set the remote branch name,\r
+ //because otherwise git will not update the remote tracking branches.\r
m_RemoteBranchName.Empty();\r
else\r
m_RemoteBranchName=m_RemoteBranch.GetString();\r