@@ -138,6 +138,42 @@ bool GitProxy::isPathGitRepo(const std::string& Path)
138138// =====================================================================
139139
140140
141+ int callRemoteProcess (openfluid::utils::Process::Command Cmd, std::string Context)
142+ {
143+ openfluid::utils::Process P (Cmd);
144+ P.run ();
145+ if (P.getExitCode () == 0 )
146+ {
147+ openfluid::utils::log::debug (" Git" , Context+" OK" );
148+ }
149+ else
150+ {
151+ openfluid::utils::log::debug (" Git" , Context+" out: " +openfluid::tools::join (P.stdOutLines (), " \n " ));
152+ openfluid::utils::log::error (" Git" , Context+" err: " +openfluid::tools::join (P.stdErrLines (), " \n " ));
153+ }
154+ return P.getExitCode ();
155+ }
156+
157+
158+ // =====================================================================
159+ // =====================================================================
160+
161+
162+ int GitProxy::clone (const std::string& Path, const std::string& URL, const std::string& LocalName)
163+ {
164+ openfluid::utils::Process::Command Cmd{
165+ .Program = m_ExecutablePath,
166+ .Args = {" clone" , " --recurse-submodules" , URL, LocalName},
167+ .WorkDir = Path
168+ };
169+ return callRemoteProcess (Cmd, " Git clone " +URL+" at " +Path+" as " +LocalName);
170+ }
171+
172+
173+ // =====================================================================
174+ // =====================================================================
175+
176+
141177const std::string GitProxy::getCurrentBranchName (const std::string& Path)
142178{
143179 if (!canGetBranch ())
@@ -171,27 +207,6 @@ const std::string GitProxy::getCurrentBranchName(const std::string& Path)
171207// =====================================================================
172208
173209
174- int callRemoteProcess (openfluid::utils::Process::Command Cmd, std::string Context)
175- {
176- openfluid::utils::Process P (Cmd);
177- P.run ();
178- if (P.getExitCode () == 0 )
179- {
180- openfluid::utils::log::debug (" Git" , Context+" OK" );
181- }
182- else
183- {
184- openfluid::utils::log::debug (" Git" , Context+" out: " +openfluid::tools::join (P.stdOutLines (), " \n " ));
185- openfluid::utils::log::error (" Git" , Context+" err: " +openfluid::tools::join (P.stdErrLines (), " \n " ));
186- }
187- return P.getExitCode ();
188- }
189-
190-
191- // =====================================================================
192- // =====================================================================
193-
194-
195210int GitProxy::setRemote (const std::string RepoPath, const std::string RemoteUrl)
196211{
197212 if (isPathGitRepo (RepoPath))
0 commit comments