1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2009-2013 - 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 "ResolveCommand.h"
23 #include "MessageBox.h"
24 #include "ResolveDlg.h"
25 #include "GITProgressDlg.h"
27 bool ResolveCommand::Execute()
30 dlg
.m_pathList
= pathList
;
32 if (!parser
.HasKey(_T("noquestion")))
36 if (dlg
.m_pathList
.GetCount())
38 if (parser
.HasKey(L
"silent"))
40 for (int i
= 0; i
< dlg
.m_pathList
.GetCount(); ++i
)
43 cmd
.Format(_T("git.exe add -f -- \"%s\""), dlg
.m_pathList
[i
].GetGitPathString());
44 if (g_Git
.Run(cmd
, &out
, CP_UTF8
))
46 CMessageBox::Show(NULL
, out
, _T("TortoiseGit"), MB_OK
| MB_ICONERROR
);
50 CAppUtils::RemoveTempMergeFile((CTGitPath
&)dlg
.m_pathList
[i
]);
56 CGitProgressDlg
progDlg(CWnd::FromHandle(hWndExplorer
));
57 theApp
.m_pMainWnd
= &progDlg
;
58 progDlg
.SetCommand(CGitProgressList::GitProgress_Resolve
);
59 if (parser
.HasVal(_T("closeonend")))
60 progDlg
.SetAutoClose(parser
.GetLongVal(_T("closeonend")));
61 progDlg
.SetOptions(parser
.HasKey(_T("skipcheck")) ? ProgOptSkipConflictCheck
: ProgOptNone
);
62 progDlg
.SetPathList(dlg
.m_pathList
);
64 return !progDlg
.DidErrorsOccur();