From cf9192a89d1c5d1a91a228d27634340211cb32f8 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 19 Jul 2015 15:06:21 +0200 Subject: [PATCH] Fixed issue #2529: The status of files which are not checked should be the same after commit Signed-off-by: Sven Strickroth --- src/Changelog.txt | 2 ++ src/TortoiseProc/CommitDlg.cpp | 14 ++++++++++++++ src/TortoiseProc/RebaseDlg.cpp | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/src/Changelog.txt b/src/Changelog.txt index 1ae3cd652..b45b81f59 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -22,6 +22,8 @@ Released: unreleased * Fixed issue #2517: Submodule Update dialog cannot be re-sized and is too small to be useful in some cases * Fixed issue #2504: Problems with MS Outlook and generated emails * Optimized TortoiseGitBlame to be used with high contrast themes and black background colors + * Fixed issue #2529: The status of files which are not checked should be the same after commit + Unchecked deleted/renamed files were not put into previous state in index after commit = Release 1.8.14.0 = Released: 2015-04-08 diff --git a/src/TortoiseProc/CommitDlg.cpp b/src/TortoiseProc/CommitDlg.cpp index d5564a517..b10b762d2 100644 --- a/src/TortoiseProc/CommitDlg.cpp +++ b/src/TortoiseProc/CommitDlg.cpp @@ -646,6 +646,7 @@ void CCommitDlg::OnOK() int nchecked = 0; CMassiveGitTask mgtReAddAfterCommit(_T("add --ignore-errors -f")); + CMassiveGitTask mgtReDelAfterCommit(_T("rm --cached --ignore-unmatch")); CString cmd; CString out; @@ -785,7 +786,12 @@ void CCommitDlg::OnOK() ++nchecked; } else if (entry->m_Action & CTGitPath::LOGACTIONS_ADDED || entry->m_Action & CTGitPath::LOGACTIONS_REPLACED) + { mgtReAddAfterCommit.AddFile(*entry); + mgtReDelAfterCommit.AddFile(entry->GetGitOldPathString()); + } + else if (entry->m_Action & CTGitPath::LOGACTIONS_DELETED) + mgtReDelAfterCommit.AddFile(entry->GetGitPathString()); if (sysProgressDlg.HasUserCancelled()) { @@ -839,10 +845,17 @@ void CCommitDlg::OnOK() mgtReAddAfterCommit.AddFile(*entry); if (entry->m_Action & CTGitPath::LOGACTIONS_REPLACED && !entry->GetGitOldPathString().IsEmpty()) + { mgtReset.AddFile(entry->GetGitOldPathString()); + mgtReDelAfterCommit.AddFile(entry->GetGitOldPathString()); + } } else if (!(entry->m_Action & CTGitPath::LOGACTIONS_UNVER)) + { mgtReset.AddFile(entry->GetGitPathString()); + if (entry->m_Action & CTGitPath::LOGACTIONS_DELETED) + mgtReDelAfterCommit.AddFile(entry->GetGitPathString()); + } } if (sysProgressDlg.HasUserCancelled()) @@ -1081,6 +1094,7 @@ void CCommitDlg::OnOK() { BOOL cancel = FALSE; mgtReAddAfterCommit.Execute(cancel); + mgtReDelAfterCommit.Execute(cancel); } } else if(bAddSuccess) diff --git a/src/TortoiseProc/RebaseDlg.cpp b/src/TortoiseProc/RebaseDlg.cpp index 0fe680463..249e24805 100644 --- a/src/TortoiseProc/RebaseDlg.cpp +++ b/src/TortoiseProc/RebaseDlg.cpp @@ -1124,6 +1124,7 @@ void CRebaseDlg::OnBnClickedContinue() // ATTENTION: Similar code in CommitDlg.cpp!!! // *************************************************** CMassiveGitTask mgtReAddAfterCommit(_T("add --ignore-errors -f")); + CMassiveGitTask mgtReDelAfterCommit(_T("rm --cached --ignore-unmatch")); CMassiveGitTask mgtAdd(_T("add -f")); CMassiveGitTask mgtUpdateIndexForceRemove(_T("update-index --force-remove")); CMassiveGitTask mgtUpdateIndex(_T("update-index")); @@ -1153,10 +1154,17 @@ void CRebaseDlg::OnBnClickedContinue() mgtReAddAfterCommit.AddFile(*entry); if (entry->m_Action & CTGitPath::LOGACTIONS_REPLACED && !entry->GetGitOldPathString().IsEmpty()) + { mgtReset.AddFile(entry->GetGitOldPathString()); + mgtReDelAfterCommit.AddFile(entry->GetGitOldPathString()); + } } else if(!(entry->m_Action & CTGitPath::LOGACTIONS_UNVER)) + { mgtReset.AddFile(entry->GetGitPathString()); + if (entry->m_Action & CTGitPath::LOGACTIONS_DELETED) + mgtReDelAfterCommit.AddFile(entry->GetGitPathString()); + } } } @@ -1230,6 +1238,7 @@ void CRebaseDlg::OnBnClickedContinue() { BOOL cancel2 = FALSE; mgtReAddAfterCommit.Execute(cancel2); + mgtReDelAfterCommit.Execute(cancel2); } this->m_ctrlTabCtrl.SetActiveTab(REBASE_TAB_LOG); -- 2.11.4.GIT