1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2009-2012, 2015 - TortoiseGit
4 // Copyright (C) 2007-2008 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "RebaseCommand.h"
23 #include "MessageBox.h"
24 #include "RebaseDlg.h"
26 #include "SysProgressDlg.h"
29 bool RebaseCommand::Execute()
33 if(!g_Git
.CheckCleanWorkTree())
35 if (CMessageBox::Show(NULL
, IDS_ERROR_NOCLEAN_STASH
, IDS_APPNAME
, 1, IDI_QUESTION
, IDS_STASHBUTTON
, IDS_ABORTBUTTON
) == 1)
37 CSysProgressDlg sysProgressDlg
;
38 sysProgressDlg
.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME
)));
39 sysProgressDlg
.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_STASHRUNNING
)));
40 sysProgressDlg
.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT
)));
41 sysProgressDlg
.SetShowProgressBar(false);
42 sysProgressDlg
.SetCancelMsg(IDS_PROGRS_INFOFAILED
);
43 sysProgressDlg
.ShowModeless((HWND
)NULL
, true);
46 cmd
=_T("git.exe stash");
47 if (g_Git
.Run(cmd
, &out
, CP_UTF8
))
49 sysProgressDlg
.Stop();
50 CMessageBox::Show(NULL
,out
,_T("TortoiseGit"),MB_OK
);
53 sysProgressDlg
.Stop();
64 dlg
.m_PostButtonTexts
.Add(CString(MAKEINTRESOURCE(IDS_MENULOG
)));
65 dlg
.m_PostButtonTexts
.Add(CString(MAKEINTRESOURCE(IDS_PROC_RESTARTREBASE
)));
66 INT_PTR ret
= dlg
.DoModal();
77 if (ret
== IDC_REBASE_POST_BUTTON
)
79 CString cmd
= _T("/command:log");
80 cmd
+= _T(" /path:\"") + g_Git
.m_CurrentDir
+ _T("\"");
81 CAppUtils::RunTortoiseGitProc(cmd
);