OSDN Git Service

Pull: Fixed bug that when pulling from the configured remote branch, git did not...
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / PullFetchDlg.cpp
index 18073cd..92ff743 100644 (file)
@@ -103,11 +103,11 @@ BOOL CPullFetchDlg::OnInitDialog()
        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
@@ -158,7 +158,10 @@ void CPullFetchDlg::OnBnClickedOk()
        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