summaryrefslogtreecommitdiff
path: root/src/plugins/diffeditor/diffutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/diffeditor/diffutils.cpp')
-rw-r--r--src/plugins/diffeditor/diffutils.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp
index b5ed3a6209..589c4ddb84 100644
--- a/src/plugins/diffeditor/diffutils.cpp
+++ b/src/plugins/diffeditor/diffutils.cpp
@@ -918,39 +918,39 @@ static FileData readGitHeaderAndChunks(const QString &headerAndChunks,
fileData.rightFileInfo.typeInfo = indexRegExp.cap(2);
patch.remove(0, indexRegExp.matchedLength());
+ }
- const QRegExp leftFileRegExp(QLatin1String("^-{3} ") // "--- "
- + leftFileName // "a/fileName" or "/dev/null"
- + QLatin1String("(?:\\t[^\\n]*)*\\n")); // optionally followed by: \t anything \t anything ...)
- const QRegExp rightFileRegExp(QLatin1String("^\\+{3} ") // "+++ "
- + rightFileName // "b/fileName" or "/dev/null"
- + QLatin1String("(?:\\t[^\\n]*)*\\n")); // optionally followed by: \t anything \t anything ...)
- const QRegExp binaryRegExp(QLatin1String("^Binary files ")
- + leftFileName
- + QLatin1String(" and ")
- + rightFileName
- + QLatin1String(" differ$"));
-
- // empty or followed either by leftFileRegExp or by binaryRegExp
- if (patch.isEmpty() && (fileData.fileOperation == FileData::NewFile
- || fileData.fileOperation == FileData::DeleteFile)) {
- readOk = true;
- } else if (leftFileRegExp.indexIn(patch) == 0) {
- patch.remove(0, leftFileRegExp.matchedLength());
+ const QRegExp leftFileRegExp(QLatin1String("^-{3} ") // "--- "
+ + leftFileName // "a/fileName" or "/dev/null"
+ + QLatin1String("(?:\\t[^\\n]*)*\\n")); // optionally followed by: \t anything \t anything ...)
+ const QRegExp rightFileRegExp(QLatin1String("^\\+{3} ") // "+++ "
+ + rightFileName // "b/fileName" or "/dev/null"
+ + QLatin1String("(?:\\t[^\\n]*)*\\n")); // optionally followed by: \t anything \t anything ...)
+ const QRegExp binaryRegExp(QLatin1String("^Binary files ")
+ + leftFileName
+ + QLatin1String(" and ")
+ + rightFileName
+ + QLatin1String(" differ$"));
+
+ // empty or followed either by leftFileRegExp or by binaryRegExp
+ if (patch.isEmpty() && (fileData.fileOperation == FileData::NewFile
+ || fileData.fileOperation == FileData::DeleteFile)) {
+ readOk = true;
+ } else if (leftFileRegExp.indexIn(patch) == 0) {
+ patch.remove(0, leftFileRegExp.matchedLength());
- // followed by rightFileRegExp
- if (rightFileRegExp.indexIn(patch) == 0) {
- patch.remove(0, rightFileRegExp.matchedLength());
+ // followed by rightFileRegExp
+ if (rightFileRegExp.indexIn(patch) == 0) {
+ patch.remove(0, rightFileRegExp.matchedLength());
- fileData.chunks = readChunks(patch,
- ignoreWhitespace,
- &fileData.lastChunkAtTheEndOfFile,
- &readOk);
- }
- } else if (binaryRegExp.indexIn(patch) == 0) {
- readOk = true;
- fileData.binaryFiles = true;
+ fileData.chunks = readChunks(patch,
+ ignoreWhitespace,
+ &fileData.lastChunkAtTheEndOfFile,
+ &readOk);
}
+ } else if (binaryRegExp.indexIn(patch) == 0) {
+ readOk = true;
+ fileData.binaryFiles = true;
}
if (ok)