From bae014822df49651d7fea11fba6748c410a44d9b Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 26 Jan 2024 11:17:06 +0100 Subject: [PATCH] Fix: set version info several times to reflect real current git commit --- worker.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/worker.cpp b/worker.cpp index ed3a178..5d31489 100644 --- a/worker.cpp +++ b/worker.cpp @@ -358,9 +358,7 @@ void Worker::privateUpdate() { setProgress(i); // and switch to branch if (m_gc.gitCloneAndCheckoutBranch()) { if (!isRepositoryCorrupted()) { - if (m_versionInfo.size() == 0) { - m_versionInfo = m_gc.gitShowReason(m_branchName); - } + m_versionInfo = m_gc.gitShowReason(m_branchName); GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CLONE_REPOSITORY_SUCCESS)); continueUpdate = true; m_clone = true; @@ -390,10 +388,7 @@ void Worker::privateUpdate() { } } } - - if (m_versionInfo.size() == 0) { - m_versionInfo = m_gc.gitShowReason(m_branchName); - } + m_versionInfo = m_gc.gitShowReason(m_branchName); CONSOLE() << UPDATE_STEP::CHECK_REPOSITORY_SUCCESS; setProgress(_CHECKOUT_REPOSITORY_SUCCESS); @@ -411,9 +406,6 @@ void Worker::privateUpdate() { } } - qCritical() << "**** m_ismasTriggerActive:" << m_ismasTriggerActive; - qCritical() << "**** m_clone:" << m_clone; - if (m_ismasTriggerActive == false) {// make it explicit again: only if the // ismas trigger is active ('WAIT'), // then proceed @@ -432,11 +424,11 @@ void Worker::privateUpdate() { if ((continueUpdate = customerEnvironment()) == false) { return; } + m_versionInfo = m_gc.gitShowReason(m_branchName); lst = QStringList(QString(smap[UPDATE_STEP::CHECKOUT_BRANCH_SUCCESS])); ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::CHECKOUT_BRANCH); setProgress(_CHECKOUT_BRANCH_SUCCESS); - //////////////////////////////////////////////////////////////////////////// // // COMPUTE CHANGED FILES OF CUSTOMER REPOSITORY @@ -445,6 +437,7 @@ void Worker::privateUpdate() { if ((continueUpdate = filesToUpdate()) == false) { return; } + m_versionInfo = m_gc.gitShowReason(m_branchName); lst = QStringList(QString(smap[UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS])); ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_REPOSITORY)); setProgress(_UPDATE_REPOSITORY_SUCCESS); @@ -1190,6 +1183,8 @@ PSAInstalled Worker::getPSAInstalled() { psaInstalled.versionInfo.created = "N/A"; if (m_versionInfo.size() == 3) { + qCritical() << QString("***** %1:%2").arg(__func__).arg(__LINE__) + << "m_versionInfo" << m_versionInfo << "*****"; psaInstalled.versionInfo.lastCommit = m_versionInfo.at(0); psaInstalled.versionInfo.reason = m_versionInfo.at(1); psaInstalled.versionInfo.created = m_versionInfo.at(2);