Fix: set version info several times to reflect real current git commit

This commit is contained in:
Gerhard Hoffmann 2024-01-26 11:17:06 +01:00
parent 6c472b542e
commit bae014822d

View File

@ -358,9 +358,7 @@ void Worker::privateUpdate() {
setProgress(i); // and switch to branch setProgress(i); // and switch to branch
if (m_gc.gitCloneAndCheckoutBranch()) { if (m_gc.gitCloneAndCheckoutBranch()) {
if (!isRepositoryCorrupted()) { 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)); GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CLONE_REPOSITORY_SUCCESS));
continueUpdate = true; continueUpdate = true;
m_clone = true; m_clone = true;
@ -390,10 +388,7 @@ void Worker::privateUpdate() {
} }
} }
} }
m_versionInfo = m_gc.gitShowReason(m_branchName);
if (m_versionInfo.size() == 0) {
m_versionInfo = m_gc.gitShowReason(m_branchName);
}
CONSOLE() << UPDATE_STEP::CHECK_REPOSITORY_SUCCESS; CONSOLE() << UPDATE_STEP::CHECK_REPOSITORY_SUCCESS;
setProgress(_CHECKOUT_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 if (m_ismasTriggerActive == false) {// make it explicit again: only if the
// ismas trigger is active ('WAIT'), // ismas trigger is active ('WAIT'),
// then proceed // then proceed
@ -432,11 +424,11 @@ void Worker::privateUpdate() {
if ((continueUpdate = customerEnvironment()) == false) { if ((continueUpdate = customerEnvironment()) == false) {
return; return;
} }
m_versionInfo = m_gc.gitShowReason(m_branchName);
lst = QStringList(QString(smap[UPDATE_STEP::CHECKOUT_BRANCH_SUCCESS])); lst = QStringList(QString(smap[UPDATE_STEP::CHECKOUT_BRANCH_SUCCESS]));
ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::CHECKOUT_BRANCH); ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::CHECKOUT_BRANCH);
setProgress(_CHECKOUT_BRANCH_SUCCESS); setProgress(_CHECKOUT_BRANCH_SUCCESS);
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// COMPUTE CHANGED FILES OF CUSTOMER REPOSITORY // COMPUTE CHANGED FILES OF CUSTOMER REPOSITORY
@ -445,6 +437,7 @@ void Worker::privateUpdate() {
if ((continueUpdate = filesToUpdate()) == false) { if ((continueUpdate = filesToUpdate()) == false) {
return; return;
} }
m_versionInfo = m_gc.gitShowReason(m_branchName);
lst = QStringList(QString(smap[UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS])); lst = QStringList(QString(smap[UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS]));
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_REPOSITORY)); ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_REPOSITORY));
setProgress(_UPDATE_REPOSITORY_SUCCESS); setProgress(_UPDATE_REPOSITORY_SUCCESS);
@ -1190,6 +1183,8 @@ PSAInstalled Worker::getPSAInstalled() {
psaInstalled.versionInfo.created = "N/A"; psaInstalled.versionInfo.created = "N/A";
if (m_versionInfo.size() == 3) { 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.lastCommit = m_versionInfo.at(0);
psaInstalled.versionInfo.reason = m_versionInfo.at(1); psaInstalled.versionInfo.reason = m_versionInfo.at(1);
psaInstalled.versionInfo.created = m_versionInfo.at(2); psaInstalled.versionInfo.created = m_versionInfo.at(2);