Skip to content
Snippets Groups Projects

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

Merged Hahn Axel (hahn) requested to merge 7963-build-error-on-missing-repo-access into master
1 file
+ 7
4
Compare changes
  • Side-by-side
  • Inline
@@ -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) {
Loading