OSDN Git Service

Fix issue 17 Switch should default branch to current branch
authorFrank Li <lznuaa@gmail.com>
Wed, 4 Feb 2009 03:14:43 +0000 (11:14 +0800)
committerFrank Li <lznuaa@gmail.com>
Wed, 4 Feb 2009 03:14:43 +0000 (11:14 +0800)
Also fix push list local branch add remote branch

Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/Git.cpp
src/TortoiseProc/GitSwitchDlg.cpp
src/TortoiseProc/PushDlg.cpp

index a308409..f000ef0 100644 (file)
@@ -552,12 +552,12 @@ int CGit::GetBranchList(STRING_VECTOR &list,int *current,BRANCH_TYPE type)
                CString one;\r
                while( pos>=0 )\r
                {\r
                CString one;\r
                while( pos>=0 )\r
                {\r
-                       i++;\r
                        one=output.Tokenize(_T("\n"),pos);\r
                        list.push_back(one.Right(one.GetLength()-2));\r
                        if(one[0] == _T('*'))\r
                                if(current)\r
                                        *current=i;\r
                        one=output.Tokenize(_T("\n"),pos);\r
                        list.push_back(one.Right(one.GetLength()-2));\r
                        if(one[0] == _T('*'))\r
                                if(current)\r
                                        *current=i;\r
+                       i++;\r
                }\r
        }\r
        return ret;\r
                }\r
        }\r
        return ret;\r
index e11f849..1513daa 100644 (file)
@@ -58,10 +58,11 @@ BOOL CGitSwitchDlg::OnInitDialog()
 \r
        \r
        CHOOSE_VERSION_ADDANCHOR;\r
 \r
        \r
        CHOOSE_VERSION_ADDANCHOR;\r
-       Init();\r
 \r
        EnableSaveRestore(_T("SwitchDlg"));\r
 \r
 \r
        EnableSaveRestore(_T("SwitchDlg"));\r
 \r
+       Init();\r
+\r
        if(m_Base.IsEmpty())\r
                SetDefaultChoose(IDC_RADIO_BRANCH);\r
        else\r
        if(m_Base.IsEmpty())\r
                SetDefaultChoose(IDC_RADIO_BRANCH);\r
        else\r
index 693dd5f..8f35c3d 100644 (file)
@@ -78,6 +78,7 @@ BOOL CPushDlg::OnInitDialog()
        }\r
 \r
        int current=0;\r
        }\r
 \r
        int current=0;\r
+       list.clear();\r
        if(!g_Git.GetBranchList(list,&current))\r
        {\r
                for(unsigned int i=0;i<list.size();i++)\r
        if(!g_Git.GetBranchList(list,&current))\r
        {\r
                for(unsigned int i=0;i<list.size();i++)\r