OSDN Git Service

Pull: Fixed bug that when pulling from the configured remote branch, git did not...
authorJohan 't Hart <johanthart@gmail.com>
Sun, 28 Jun 2009 11:49:31 +0000 (13:49 +0200)
committerJohan 't Hart <johanthart@gmail.com>
Sun, 28 Jun 2009 11:49:31 +0000 (13:49 +0200)
the command:
git pull origin master
Does not update the remote tracking branches. The command
git pull origin
does.

This bug was introduced in commit 25bd4c961830590ffdb51202e935fd168b7b2484

src/TortoiseProc/PullFetchDlg.cpp
src/TortoiseProc/PullFetchDlg.h

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
index 61a5428..469d774 100644 (file)
@@ -39,4 +39,7 @@ public:
        CString m_RemoteBranchName;\r
     afx_msg void OnStnClickedRemoteManage();\r
        afx_msg void OnBnClickedButtonBrowseRef();\r
+\r
+       CString         m_configPullRemote;\r
+       CString         m_configPullBranch;\r
 };\r