DiffEditor: Fix saving diff containing new or deleted files

Fix also the case when new file was empty.
Fix some const correctness.

Change-Id: Ied71c3de0398914e595fbf542f1b8ec3659d69b6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jarek Kobus
2017-07-11 09:44:35 +02:00
parent e3ce4b150d
commit 6213369675
2 changed files with 56 additions and 18 deletions

View File

@@ -856,7 +856,7 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch()
QFETCH(bool, lastChunk);
QFETCH(QString, patchText);
QString result = DiffUtils::makePatch(sourceChunk, leftFileName, rightFileName, lastChunk);
const QString result = DiffUtils::makePatch(sourceChunk, leftFileName, rightFileName, lastChunk);
QCOMPARE(result, patchText);