Skip to content
Snippets Groups Projects
Commit 7e734cde authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '7963-build-error-on-missing-repo-access' into 'master'

OP#7963 CI Server fails on function [build]  https://projects.iml.unibe.ch/work_packages/7963vcs git: do not return boolean false but array with key error

See merge request !87
parents ca920a6d 7b8fa0eb
No related branches found
No related tags found
1 merge request!87OP#7963 CI Server fails on function [build] https://projects.iml.unibe.ch/work_packages/7963vcs git: do not return boolean false but array with key error
Pipeline #4984 passed
...@@ -404,16 +404,19 @@ class vcs implements iVcs ...@@ -404,16 +404,19 @@ class vcs implements iVcs
/** /**
* Get current revision and commit message from remote repository * Get current revision and commit message from remote repository
* @see $this::getRevision * @see $this::getRevision
* It returns false if no branch is set * It returns a key "error" if no branch is set
* *
* @param boolean $bRefresh optional: refresh data; default: use cache * @param boolean $bRefresh optional: refresh data; default: use cache
* @return bool|array * @return array
*/ */
public function getRepoRevision(bool $bRefresh = false): bool|array public function getRepoRevision(bool $bRefresh = false): array
{ {
$this->log(__FUNCTION__ . "($bRefresh) start"); $this->log(__FUNCTION__ . "($bRefresh) start");
if (!$this->_sCurrentBranch) { if (!$this->_sCurrentBranch) {
return false; return [
"error" => "Error: Current git branch was not detected.",
];
// return false;
} }
$sMessage = $this->getCommitmessageByBranch(false, $bRefresh ? 'dummy_to_force_refresh' : false); $sMessage = $this->getCommitmessageByBranch(false, $bRefresh ? 'dummy_to_force_refresh' : false);
if ($sMessage) { if ($sMessage) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment