Commit 58ef7931 authored by Francis Herne's avatar Francis Herne
Browse files

Don't hit assertion with "View Diff"

Commit 0c9ff4de caused KDevelop to crash on "View Diff" in almost all
 cases, because it didn't check
  `dstRevision.revisionType() == VcsRevision::Special`
 before calling `dstRevision.specialType()`.

BUG: 373763

I have other doubts about that commit, but for now just fix the bug.
parent 4856e49d
......@@ -357,13 +357,14 @@ VcsJob* GitPlugin::diff(const QUrl& fileOrDirectory, const KDevelop::VcsRevision
// has become optional.
*job << "--no-prefix";
}
if(srcRevision.revisionType()==VcsRevision::Special
&& dstRevision.revisionType()==VcsRevision::Special
&& srcRevision.specialType()==VcsRevision::Base
&& dstRevision.specialType()==VcsRevision::Working)
*job << "HEAD";
else if(dstRevision.specialType()==VcsRevision::Working){
*job << "--cached" << srcRevision.revisionValue().toString();
if (dstRevision.revisionType() == VcsRevision::Special &&
dstRevision.specialType() == VcsRevision::Working) {
if (srcRevision.revisionType() == VcsRevision::Special &&
srcRevision.specialType() == VcsRevision::Base) {
*job << "HEAD";
} else {
*job << "--cached" << srcRevision.revisionValue().toString();
}
} else {
QString revstr = revisionInterval(srcRevision, dstRevision);
if(!revstr.isEmpty())
......
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