OSDN Git Service

Commit: Made user able to push after successful commit
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / CommitDlg.cpp
index fb5a5d0..0dbf8e6 100644 (file)
@@ -34,6 +34,7 @@
 #include "UnicodeUtils.h"\r
 #include "ProgressDlg.h"\r
 #include "ShellUpdater.h"\r
+#include "Commands/PushCommand.h"\r
 \r
 #ifdef _DEBUG\r
 #define new DEBUG_NEW\r
@@ -501,13 +502,20 @@ void CCommitDlg::OnOK()
                progress.m_GitCmd=cmd;\r
                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
+               progress.m_changeAbortButtonOnSuccessTo = "Push";\r
+               DWORD userResponse = progress.DoModal();\r
                \r
                if(progress.m_GitStatus)\r
                {\r
                        bCloseCommitDlg = false;\r
                        this->Refresh();\r
                }\r
+               else if(userResponse == IDCANCEL)\r
+               {\r
+                       //User pressed 'Push' button after successful commit.\r
+                       PushCommand cmdPush;\r
+                       cmdPush.Execute();\r
+               }\r
 \r
                CFile::Remove(tempfile);\r
        }else\r