OSDN Git Service

Fix Issue 27: Deleted files not committed
authorFrank Li <lznuaa@gmail.com>
Thu, 5 Feb 2009 08:13:51 +0000 (16:13 +0800)
committerFrank Li <lznuaa@gmail.com>
Thu, 5 Feb 2009 08:13:51 +0000 (16:13 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/CommitDlg.cpp

index a193f78..a8550b7 100644 (file)
@@ -395,7 +395,13 @@ void CCommitDlg::OnOK()
                                bCheckedInExternal = true;\r
                        }\r
 #endif\r
-                       cmd.Format(_T("git.exe update-index --add -- \"%s\""),entry->GetGitPathString());\r
+                       if( entry->m_Action & CTGitPath::LOGACTIONS_ADDED)\r
+                               cmd.Format(_T("git.exe update-index --add -f -- \"%s\""),entry->GetGitPathString());\r
+                       else if ( entry->m_Action & CTGitPath::LOGACTIONS_DELETED)\r
+                               cmd.Format(_T("git.exe update-index --remove -- \"%s\""),entry->GetGitPathString());\r
+                       else\r
+                               cmd.Format(_T("git.exe update-index  -- \"%s\""),entry->GetGitPathString());\r
+\r
                        g_Git.Run(cmd,&out,CP_OEMCP);\r
                        nchecked++;\r
                        //checkedLists.insert(entry->GetGitPathString());\r