From c946ba9114eabf857e8bec4116851b0b93b8023e Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 17 Mar 2013 16:21:27 +0100 Subject: [PATCH] Fixed issue #1702: Original commit message is showen even though it is changed during rebase Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/RebaseDlg.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Changelog.txt b/src/Changelog.txt index 974768339..c97015eaf 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -52,6 +52,7 @@ Released: unreleased * Fixed issue #1276: Cannot show diff of renamed file * Fixed issue #1696: Fetch from switch dialog does not refresh branches list * Fixed issue #1701: Changing commit order in rebase dialog doesn't auto scroll + * Fixed issue #1702: Original commit message is showen even though it is changed during rebase = Release 1.8.1.0 = Released: 2013-02-07 diff --git a/src/TortoiseProc/RebaseDlg.cpp b/src/TortoiseProc/RebaseDlg.cpp index e6daf3f14..24b8aae5e 100644 --- a/src/TortoiseProc/RebaseDlg.cpp +++ b/src/TortoiseProc/RebaseDlg.cpp @@ -1142,6 +1142,35 @@ void CRebaseDlg::OnBnClickedContinue() AddLogString(out); + // update commit message if needed + CString str = m_LogMessageCtrl.GetText().Trim(); + if (str != (curRev->GetSubject() + _T("\n") + curRev->GetBody()).Trim()) + { + if (str.Trim().IsEmpty()) + { + CMessageBox::Show(NULL, IDS_PROC_COMMITMESSAGE_EMPTY,IDS_APPNAME, MB_OK | MB_ICONERROR); + return; + } + CString tempfile = ::GetTempFile(); + CAppUtils::SaveCommitUnicodeFile(tempfile, str); + + out.Empty(); + cmd.Format(_T("git.exe commit --amend -F \"%s\""), tempfile); + AddLogString(cmd); + + if (g_Git.Run(cmd, &out, CP_UTF8)) + { + AddLogString(out); + if (!g_Git.CheckCleanWorkTree()) + { + CMessageBox::Show(NULL, out, _T("TortoiseGit"), MB_OK | MB_ICONERROR); + return; + } + } + + AddLogString(out); + } + if (((DWORD)CRegStdDWORD(_T("Software\\TortoiseGit\\ReaddUnselectedAddedFilesAfterCommit"), TRUE)) == TRUE) { BOOL cancel = FALSE; -- 2.11.4.GIT