OSDN Git Service

Fix Issue 27: Deleted files not committed
[tortoisegit/TortoiseGitJp.git] / 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