Commit 6567db9c authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Delete unused cloneRepository function

It is now implemented by the wizard, using
GitVersionControl::createInitialCheckoutCommand.

Change-Id: Ie847402cf1bc22444d2142baa57bfac6a136fb8f
Reviewed-by: default avatarAndré Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent b7021f83
......@@ -3000,45 +3000,6 @@ QString GitClient::readOneLine(const QString &workingDirectory, const QStringLis
return resp.stdOut().trimmed();
}
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
{
QDir workingDirectory(directory);
const unsigned flags = VcsCommand::SshPasswordPrompt
| VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage;
if (workingDirectory.exists()) {
if (!synchronousInit(workingDirectory.path()))
return false;
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDirectory.path(), { "remote", "add", "origin", QString::fromUtf8(url) });
if (resp.result != SynchronousProcessResponse::Finished)
return false;
const SynchronousProcessResponse resp1 = vcsSynchronousExec(
workingDirectory.path(), { "fetch" }, flags);
if (resp1.result != SynchronousProcessResponse::Finished)
return false;
const SynchronousProcessResponse resp2 = vcsSynchronousExec(
workingDirectory.path(), { "config", "branch.master.remote", "origin" }, flags);
if (resp2.result != SynchronousProcessResponse::Finished)
return false;
const SynchronousProcessResponse resp3 = vcsSynchronousExec(
workingDirectory.path(),
{ "config", "branch.master.merge", "refs/heads/master" }, flags);
return resp3.result == SynchronousProcessResponse::Finished;
} else {
workingDirectory.cdUp();
const SynchronousProcessResponse resp = vcsSynchronousExec(
workingDirectory.path(),
{ "clone", QString::fromUtf8(url), workingDirectory.dirName() }, flags);
resetCachedVcsInfo(workingDirectory.absolutePath());
return (resp.result == SynchronousProcessResponse::Finished);
}
}
// determine version as '(major << 16) + (minor << 8) + patch' or 0.
unsigned GitClient::gitVersion(QString *errorMessage) const
{
......
......@@ -242,7 +242,6 @@ public:
bool isRemoteCommit(const QString &workingDirectory, const QString &commit);
bool isFastForwardMerge(const QString &workingDirectory, const QString &branch);
bool cloneRepository(const QString &directory, const QByteArray &url);
void fetch(const QString &workingDirectory, const QString &remote);
bool synchronousPull(const QString &workingDirectory, bool rebase);
void push(const QString &workingDirectory, const QStringList &pushArgs = QStringList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment