OSDN Git Service

Don't close commit dlg if commit fail
authorFrank Li <lznuaa@gmail.com>
Thu, 23 Apr 2009 08:44:11 +0000 (16:44 +0800)
committerFrank Li <lznuaa@gmail.com>
Thu, 23 Apr 2009 08:44:11 +0000 (16:44 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/CommitDlg.cpp

index e6b4723..34b2cb4 100644 (file)
@@ -462,6 +462,7 @@ void CCommitDlg::OnOK()
        //      g_Git.Run(cmd,&out);\r
        //}\r
 \r
+       BOOL bCloseCommitDlg=true;\r
        //if(checkedfiles.GetLength()>0)\r
        if(nchecked||m_bCommitAmend)\r
        {\r
@@ -488,7 +489,13 @@ void CCommitDlg::OnOK()
                progress.m_bShowCommand = FALSE;        // don't show the commit command\r
                progress.m_PreText = out;                       // show any output already generated in log window\r
                progress.DoModal();\r
-       \r
+               \r
+               if(progress.m_GitStatus)\r
+               {\r
+                       bCloseCommitDlg = false;\r
+                       this->Refresh();\r
+               }\r
+\r
                CFile::Remove(tempfile);\r
        }else\r
                CMessageBox::Show(this->m_hWnd, _T("Nothing Commit"), _T("Commit Finish"), MB_OK | MB_ICONINFORMATION);\r
@@ -630,7 +637,8 @@ void CCommitDlg::OnOK()
 \r
        SaveSplitterPos();\r
 \r
-       CResizableStandAloneDialog::OnOK();\r
+       if( bCloseCommitDlg )\r
+               CResizableStandAloneDialog::OnOK();\r
 \r
        CShellUpdater::Instance().Flush();\r
 }\r