From: Frank Li Date: Wed, 4 Feb 2009 03:14:43 +0000 (+0800) Subject: Fix issue 17 Switch should default branch to current branch X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=commitdiff_plain;h=6c261f381bc4e0ae5f26b9b892fb1f8f7cd27045;hp=4ad37657822182169ed93c93697e4dfaa32e3c4f Fix issue 17 Switch should default branch to current branch Also fix push list local branch add remote branch Signed-off-by: Frank Li --- diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index a308409..f000ef0 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -552,12 +552,12 @@ int CGit::GetBranchList(STRING_VECTOR &list,int *current,BRANCH_TYPE type) CString one; while( pos>=0 ) { - i++; one=output.Tokenize(_T("\n"),pos); list.push_back(one.Right(one.GetLength()-2)); if(one[0] == _T('*')) if(current) *current=i; + i++; } } return ret; diff --git a/src/TortoiseProc/GitSwitchDlg.cpp b/src/TortoiseProc/GitSwitchDlg.cpp index e11f849..1513daa 100644 --- a/src/TortoiseProc/GitSwitchDlg.cpp +++ b/src/TortoiseProc/GitSwitchDlg.cpp @@ -58,10 +58,11 @@ BOOL CGitSwitchDlg::OnInitDialog() CHOOSE_VERSION_ADDANCHOR; - Init(); EnableSaveRestore(_T("SwitchDlg")); + Init(); + if(m_Base.IsEmpty()) SetDefaultChoose(IDC_RADIO_BRANCH); else diff --git a/src/TortoiseProc/PushDlg.cpp b/src/TortoiseProc/PushDlg.cpp index 693dd5f..8f35c3d 100644 --- a/src/TortoiseProc/PushDlg.cpp +++ b/src/TortoiseProc/PushDlg.cpp @@ -78,6 +78,7 @@ BOOL CPushDlg::OnInitDialog() } int current=0; + list.clear(); if(!g_Git.GetBranchList(list,¤t)) { for(unsigned int i=0;i