SyncDlg: Make check if local branch fast-fowards to remote branch work again
[TortoiseGit.git] / src / TortoiseProc / Commands / RebaseCommand.cpp
blobcde4556421fa786eb1c0fa3e2ab861442350bbda
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2009-2012 - 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.
20 #include "StdAfx.h"
21 #include "RebaseCommand.h"
23 #include "MessageBox.h"
24 //#include "SVNProgressDlg.h"
25 //#include "ProgressDlg.h"
26 #include "RebaseDlg.h"
27 #include "InputLogDlg.h"
28 #include "Git.h"
29 #include "DirFileEnum.h"
30 #include "ShellUpdater.h"
32 bool RebaseCommand::Execute()
34 bool bRet =false;
36 if(!g_Git.CheckCleanWorkTree())
38 if(CMessageBox::Show(NULL, IDS_ERROR_NOCLEAN_STASH,IDS_APPNAME,MB_YESNO|MB_ICONINFORMATION)==IDYES)
40 CString cmd,out;
41 cmd=_T("git.exe stash");
42 if (g_Git.Run(cmd, &out, CP_UTF8))
44 CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);
45 return false;
49 else
51 return false;
55 while(1)
57 CRebaseDlg dlg;
58 dlg.m_PostButtonTexts.Add(CString(MAKEINTRESOURCE(IDS_PROC_RESTARTREBASE)));
59 INT_PTR ret = dlg.DoModal();
60 if( ret == IDOK)
62 bRet=true;
63 return bRet;
65 if( ret == IDCANCEL)
67 bRet=false;
68 return bRet;
71 return bRet;