From d4b532ed5bfd15888c82f4c0a0d63383276bc094 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 15 Oct 2025 21:31:36 +0200 Subject: [PATCH] Make external diff command work again .. by fixing SHA1 inspection in method copyFileToDiffIfNeeded where any SHA1 matched regex pattern "0*". That led the external diff feature to always compare the working directory state of a file against itself rather than comparing the version from a given commit against the version from the commit' parent. Regression from commit 1cb9acfa385e81cb9249e444603d7eff5be64c92 --- src/mainimpl.cpp | 4 +--- src/mainimpl.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mainimpl.cpp b/src/mainimpl.cpp index e88de1a..94855a4 100644 --- a/src/mainimpl.cpp +++ b/src/mainimpl.cpp @@ -291,10 +291,8 @@ void MainImpl::ActExternalDiff_activated() { } } -const QRegularExpression MainImpl::emptySha("0*"); - QString MainImpl::copyFileToDiffIfNeeded(QStringList* filenames, QString sha) { - if (emptySha.match(sha).hasMatch()) + if (sha == QGit::ZERO_SHA) { return QString(curDir + "/" + rv->st.fileName()); } diff --git a/src/mainimpl.h b/src/mainimpl.h index 77a44aa..2d0afb7 100644 --- a/src/mainimpl.h +++ b/src/mainimpl.h @@ -187,7 +187,6 @@ protected slots: QString textToFind; QRegularExpression shortLogRE; QRegularExpression longLogRE; - static const QRegularExpression emptySha; QMap revision_variables; // variables used in generic input dialogs bool setRepositoryBusy;