*filepath,GitRev::GetHead());\r
}\r
break;\r
-\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
+ POSITION pos = GetFirstSelectedItemPosition();\r
+ int index;\r
+ while ((index = GetNextSelectedItem(pos)) >= 0)\r
+ {\r
+ CTGitPath * path=(CTGitPath*)GetItemData(index);\r
+ CString cmd;\r
+ cmd.Format(_T("git.cmd add %s"),path->GetGitPathString());\r
+ CString output;\r
+ g_Git.Run(cmd,&output);\r
+ path->m_Action = CTGitPath::LOGACTIONS_ADDED;\r
+ SetEntryCheck(path,index,true);\r
+ SetItemGroup(index,0);\r
+ this->m_StatusFileList.AddPath(*path);\r
+ this->m_UnRevFileList.RemoveItem(*path);\r
+ this->m_IgnoreFileList.RemoveItem(*path);\r
+ }\r
+ \r
+ }\r
+ break;\r
#if 0\r
case IDSVNLC_COPY:\r
CopySelectedEntriesToClipboard(0);\r
\r
void CGitStatusListCtrl::StartDiff(int fileindex)\r
{\r
+ if(fileindex<0)\r
+ return;\r
CGitDiff::Diff((CTGitPath*)GetItemData(fileindex),\r
CString(GIT_REV_ZERO),\r
GitRev::GetHead());\r
}\r
}\r
\r
+void CTGitPathList::RemoveItem(CTGitPath & path)\r
+{\r
+ PathVector::iterator it;\r
+ for(it = m_paths.begin(); it != m_paths.end(); ++it)\r
+ {\r
+ if (it->GetGitPathString()==path.GetGitPathString())\r
+ {\r
+ m_paths.erase(it);\r
+ return;\r
+ }\r
+ }\r
+}\r
void CTGitPathList::RemoveChildren()\r
{\r
SortByPathname();\r
/** Removes all paths which are on or in a Subversion admin directory */\r
void RemoveAdminPaths();\r
void RemovePath(const CTGitPath& path);\r
+ void RemoveItem(CTGitPath &path);\r
/** \r
* Removes all child items and leaves only the top folders. Useful if you\r
* create the list to remove them (i.e. if you remove a parent folder, the\r