From 9d376e4575b426e5f2d214390925caf3059d3a07 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Fri, 14 Dec 2012 08:21:09 +0800 Subject: [PATCH] Fixed issue #221: After resolving all merge conflicts, it's not obvious the project needs a commit Signed-off-by: Sup Yut Sum --- src/Changelog.txt | 1 + src/TortoiseProc/AppUtils.cpp | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 26b5ebc25..8da437980 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -11,6 +11,7 @@ Released: unreleased * Fixed issue #1563: Show repository dir on Settings Dialog title bar * Fixed issue #1577: Add a retry button on Reset failure * Fixed issue #1571: Warn author not set when editing notes + * Fixed issue #221: After resolving all merge conflicts, it's not obvious the project needs a commit == Bug Fix == * Fixed issue #1535: Unclear UI in prompt dialog of Stash Save diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index 69d6bfd3f..b9d2ba249 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -2607,6 +2607,23 @@ BOOL CAppUtils::SVNDCommit() return FALSE; } +static void MergeCallback(CProgressDlg *dlg, void *caller, int result) +{ + UNREFERENCED_PARAMETER(caller); + + if (result) + { + dlg->m_PostCmdList.RemoveAll(); + + CTGitPathList list; + if (!g_Git.ListConflictFile(list) && list.GetCount() > 0) + { + // there are conflict files + dlg->m_PostCmdList.Add(CString(MAKEINTRESOURCE(IDS_PROGRS_CMD_RESOLVE))); + } + } +} + BOOL CAppUtils::Merge(CString *commit) { CMergeDlg dlg; @@ -2651,9 +2668,20 @@ BOOL CAppUtils::Merge(CString *commit) else if (dlg.m_bIsBranch) Prodlg.m_PostCmdList.Add(CString(MAKEINTRESOURCE(IDS_PROC_REMOVEBRANCH))); - INT_PTR ret = Prodlg.DoModal(); + Prodlg.m_PostCmdCallback = MergeCallback; - if (ret == IDC_PROGRESS_BUTTON1) + INT_PTR ret = Prodlg.DoModal(); + if (Prodlg.m_GitStatus != 0 && ret == IDC_PROGRESS_BUTTON1) + { + CTGitPathList pathlist; + CTGitPathList selectedlist; + pathlist.AddPath(g_Git.m_CurrentDir); + bool bSelectFilesForCommit = !!DWORD(CRegStdDWORD(_T("Software\\TortoiseGit\\SelectFilesForCommit"), TRUE)); + CString str; + CAppUtils::Commit(CString(), false, str, pathlist, selectedlist, bSelectFilesForCommit); + } + else if (ret == IDC_PROGRESS_BUTTON1) + { if (dlg.m_bNoCommit) { CString sLogMsg; @@ -2673,6 +2701,7 @@ BOOL CAppUtils::Merge(CString *commit) MessageBox(NULL, out, _T("TortoiseGit"), MB_OK); } } + } return !Prodlg.m_GitStatus; } -- 2.11.4.GIT