Commit 91cb3d32 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

In case we're comparing BASE to WORKING, add the staged changes as well.

BUG: 283352
parent 3c6893ff
......@@ -334,10 +334,19 @@ VcsJob* GitPlugin::diff(const KUrl& fileOrDirectory, const KDevelop::VcsRevision
DVcsJob* job = new GitJob(dotGitDirectory(fileOrDirectory), this, KDevelop::OutputJob::Silent);
job->setType(VcsJob::Diff);
*job << "git" << "diff" << "--no-prefix" << "--no-color" << "--no-ext-diff";
QString revstr = revisionInterval(srcRevision, dstRevision);
if(!revstr.isEmpty())
*job << revstr;
if(srcRevision.revisionType()==VcsRevision::Special
&& dstRevision.revisionType()==VcsRevision::Special
&& srcRevision.specialType()==VcsRevision::Base
&& dstRevision.specialType()==VcsRevision::Working)
*job << "HEAD";
else {
QString revstr = revisionInterval(srcRevision, dstRevision);
if(!revstr.isEmpty())
*job << revstr;
}
qDebug() << "fuuu" << (srcRevision==VcsRevision::createSpecialRevision(KDevelop::VcsRevision::Base)) << (dstRevision==VcsRevision::createSpecialRevision(KDevelop::VcsRevision::Working)) << job->dvcsCommand();
qDebug() << "faaa" << srcRevision.prettyValue() << dstRevision.prettyValue();
*job << "--" << (recursion == IBasicVersionControl::Recursive ? fileOrDirectory : preventRecursion(fileOrDirectory));
connect(job, SIGNAL(readyForParsing(KDevelop::DVcsJob*)), SLOT(parseGitDiffOutput(KDevelop::DVcsJob*)));
......
......@@ -162,6 +162,7 @@ private slots:
void parseGitStatusOutput_old(KDevelop::DVcsJob* job);
void parseGitVersionOutput(KDevelop::DVcsJob* job);
void parseGitBranchOutput(KDevelop::DVcsJob* job);
void parseGitCurrentBranch(KDevelop::DVcsJob* job);
void ctxPushStash();
void ctxPopStash();
......@@ -187,8 +188,6 @@ private:
bool m_hasError;
QString m_errorDescription;
public slots:
void parseGitCurrentBranch(KDevelop::DVcsJob*);
};
#endif
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