Commit 6c261f38 authored by 李智's avatar 李智

Fix issue 17 Switch should default branch to current branch

Also fix push list local branch add remote branch
Signed-off-by: 李智's avatarFrank Li <lznuaa@gmail.com>
parent 4ad37657
...@@ -552,12 +552,12 @@ int CGit::GetBranchList(STRING_VECTOR &list,int *current,BRANCH_TYPE type) ...@@ -552,12 +552,12 @@ int CGit::GetBranchList(STRING_VECTOR &list,int *current,BRANCH_TYPE type)
CString one; CString one;
while( pos>=0 ) while( pos>=0 )
{ {
i++;
one=output.Tokenize(_T("\n"),pos); one=output.Tokenize(_T("\n"),pos);
list.push_back(one.Right(one.GetLength()-2)); list.push_back(one.Right(one.GetLength()-2));
if(one[0] == _T('*')) if(one[0] == _T('*'))
if(current) if(current)
*current=i; *current=i;
i++;
} }
} }
return ret; return ret;
......
...@@ -58,10 +58,11 @@ BOOL CGitSwitchDlg::OnInitDialog() ...@@ -58,10 +58,11 @@ BOOL CGitSwitchDlg::OnInitDialog()
CHOOSE_VERSION_ADDANCHOR; CHOOSE_VERSION_ADDANCHOR;
Init();
EnableSaveRestore(_T("SwitchDlg")); EnableSaveRestore(_T("SwitchDlg"));
Init();
if(m_Base.IsEmpty()) if(m_Base.IsEmpty())
SetDefaultChoose(IDC_RADIO_BRANCH); SetDefaultChoose(IDC_RADIO_BRANCH);
else else
......
...@@ -78,6 +78,7 @@ BOOL CPushDlg::OnInitDialog() ...@@ -78,6 +78,7 @@ BOOL CPushDlg::OnInitDialog()
} }
int current=0; int current=0;
list.clear();
if(!g_Git.GetBranchList(list,&current)) if(!g_Git.GetBranchList(list,&current))
{ {
for(unsigned int i=0;i<list.size();i++) for(unsigned int i=0;i<list.size();i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment