Commit 126fda03 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Implemented ::repositoryLocation for git.

parent ed9b4412
......@@ -1031,6 +1031,25 @@ VcsJob* GitPlugin::move(const KUrl& source, const KUrl& destination)
return 0;
}
void GitPlugin::parseGitRepoLocationOutput(DVcsJob* job)
{
job->setResults(qVariantFromValue(KUrl(job->output())));
}
VcsJob* GitPlugin::repositoryLocation(const KUrl& localLocation)
{
DVcsJob* job = new DVcsJob(this);
if (prepareJob(job, localLocation.toLocalFile())) {
//Probably we should check first if origin is the proper remote we have to use but as a first attempt it works
*job << "git" << "config" << "remote.origin.url";
connect(job, SIGNAL(readyForParsing(DVcsJob*)), SLOT(parseGitRepoLocationOutput(DVcsJob*)));
return job;
}
delete job;
return 0;
}
VcsJob* GitPlugin::pull(const KDevelop::VcsLocation& localOrRepoLocationSrc, const KUrl& localRepositoryLocation)
{
empty_cmd();
......@@ -1055,8 +1074,3 @@ VcsJob* GitPlugin::update(const KUrl::List& localLocations, const KDevelop::VcsR
return 0;
}
VcsJob* GitPlugin::repositoryLocation(const KUrl& localLocation)
{
empty_cmd();
return 0;
}
......@@ -160,6 +160,7 @@ protected slots:
void parseGitBlameOutput(DVcsJob *job);
void parseGitLogOutput(DVcsJob *job);
void parseGitDiffOutput(DVcsJob* job);
void parseGitRepoLocationOutput(DVcsJob* job);
private:
//commit dialog "main" helper
......@@ -168,8 +169,7 @@ private:
void initBranchHash(const QString &repo);
static KDevelop::VcsStatusInfo::State charToState(const char ch);
static KDevelop::VcsStatusInfo::State lsTagToState(const char ch);
static KDevelop::VcsStatusInfo::State charToState(char ch);
QList<QStringList> branchesShas;
KUrl m_lastRepoRoot;
......
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