OSDN Git Service

Issue 74: Add multiple files from commit dialog only adds first two in multi-selection
authorFrank Li <lznuaa@gmail.com>
Fri, 24 Apr 2009 03:19:28 +0000 (11:19 +0800)
committerFrank Li <lznuaa@gmail.com>
Fri, 24 Apr 2009 03:19:28 +0000 (11:19 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/GitStatusListCtrl.cpp

index 4521750..7260bc6 100644 (file)
@@ -2683,10 +2683,18 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point)
                        case IDSVNLC_ADD:\r
                                {       // The add went ok, but we now need to run through the selected items again\r
                                        // and update their status\r
                        case IDSVNLC_ADD:\r
                                {       // The add went ok, but we now need to run through the selected items again\r
                                        // and update their status\r
+                                       std::vector<int> selectIndex;\r
+\r
                                        POSITION pos = GetFirstSelectedItemPosition();\r
                                        int index;\r
                                        while ((index = GetNextSelectedItem(pos)) >= 0)\r
                                        {\r
                                        POSITION pos = GetFirstSelectedItemPosition();\r
                                        int index;\r
                                        while ((index = GetNextSelectedItem(pos)) >= 0)\r
                                        {\r
+                                               selectIndex.push_back(index);\r
+                                       }\r
+                                       for(int i=0;i<selectIndex.size();i++)\r
+                                       {\r
+                                               index=selectIndex[i];\r
+\r
                                                CTGitPath * path=(CTGitPath*)GetItemData(index);\r
                                                ASSERT(path);\r
                                                if(path == NULL)\r
                                                CTGitPath * path=(CTGitPath*)GetItemData(index);\r
                                                ASSERT(path);\r
                                                if(path == NULL)\r
@@ -3172,7 +3180,19 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point)
                                                                        CTGitPath *path=(CTGitPath*)GetItemData(nItem);\r
                                                                        if (path->GetGitPathString()==targetList[i].GetGitPathString())\r
                                                                        {\r
                                                                        CTGitPath *path=(CTGitPath*)GetItemData(nItem);\r
                                                                        if (path->GetGitPathString()==targetList[i].GetGitPathString())\r
                                                                        {\r
-                                                                               RemoveListEntry(nItem);\r
+                                                                               if(path->m_Action & CTGitPath::LOGACTIONS_ADDED)\r
+                                                                               {\r
+                                                                                       path->m_Action = CTGitPath::LOGACTIONS_UNVER;\r
+                                                                                       SetEntryCheck(path,nItem,false);\r
+                                                                                       SetItemGroup(nItem,1);\r
+                                                                                       this->m_StatusFileList.RemoveItem(*path);\r
+                                                                                       this->m_UnRevFileList.AddPath(*path);\r
+                                                                                       //this->m_IgnoreFileList.RemoveItem(*path);\r
+\r
+                                                                               }else\r
+                                                                               {\r
+                                                                                       RemoveListEntry(nItem);\r
+                                                                               }\r
                                                                                break;\r
                                                                        }\r
                                                                }\r
                                                                                break;\r
                                                                        }\r
                                                                }\r