# # # patch "src/view/dialogs/FileDiff.cpp" # from [ed56459e0216187f0d07f2107a166f59659b58df] # to [265a8e82b7aa238024998afdbac19cc1dd41c0bb] # ============================================================ --- src/view/dialogs/FileDiff.cpp ed56459e0216187f0d07f2107a166f59659b58df +++ src/view/dialogs/FileDiff.cpp 265a8e82b7aa238024998afdbac19cc1dd41c0bb @@ -183,6 +183,31 @@ void FileDiff::diffRead() void FileDiff::diffRead() { + Diff * diff = diffModel->getDiff(fileName); + if (diff == 0) + { + QMessageBox::information( + this, + tr("File has not changed"), + tr("The file has not been changed between these revisions."), + QMessageBox::Ok + ); + reject(); + return; + } + + if (diff->is_binary) + { + QMessageBox::information( + this, + tr("File is binary"), + tr("The file is binary and cannot be diffed."), + QMessageBox::Ok + ); + reject(); + return; + } + QString base = diffModel->getBase(); if (base.isEmpty()) { @@ -225,30 +250,6 @@ void FileDiff::applyDiff() void FileDiff::applyDiff() { Diff * diff = diffModel->getDiff(fileName); - if (diff == 0) - { - QMessageBox::information( - this, - tr("File has not changed"), - tr("The file has not been changed between these revisions."), - QMessageBox::Ok - ); - reject(); - return; - } - - if (diff->is_binary) - { - QMessageBox::information( - this, - tr("File is binary"), - tr("The file is binary and cannot be diffed."), - QMessageBox::Ok - ); - reject(); - return; - } - fileModel->applyDiff(diff); diffStatusView->update(); }