Clone Support Git and SSH. Show progress during clone.
[TortoiseGit.git] / src / TortoiseProc / Commands / CloneCommand.cpp
blob9111e6e228d5b5759fe2cf360f1f5533670ec629
1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2007-2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "StdAfx.h"
20 #include "CloneCommand.h"
22 //#include "SVNProgressDlg.h"
23 #include "StringUtils.h"
24 #include "Hooks.h"
25 #include "MessageBox.h"
27 #include "CloneDlg.h"
28 #include "ProgressDlg.h"
30 bool CloneCommand::Execute()
32 CCloneDlg dlg;
33 dlg.m_Directory=this->orgCmdLinePath.GetWinPathString();
34 if(dlg.DoModal()==IDOK)
36 CString dir=dlg.m_Directory;
37 CString url=dlg.m_URL;
38 // is this a windows format UNC path, ie starts with \\
39 if (url.Find(_T("\\\\")) == 0)
41 // yes, change all \ to /
42 // this should not be necessary but msysgit does not support the use \ here yet
43 url.Replace( _T('\\'), _T('/'));
45 CString cmd;
46 cmd.Format(_T("git.exe clone -v \"%s\" \"%s\""),
47 url,
48 dir);
49 CProgressDlg progress;
50 progress.m_GitCmd=cmd;
51 if(progress.DoModal()==IDOK)
52 return TRUE;
55 return FALSE;