Skip to content
Snippets Groups Projects

Task4364 branchname chars; do not fetch all commit messages

Merged Hahn Axel (hahn) requested to merge task4364-branchname-chars into master
3 files
+ 17
10
Compare changes
  • Side-by-side
  • Inline

Files

+ 10
6
@@ -10,6 +10,7 @@
@@ -10,6 +10,7 @@
*
*
* ----------------------------------------------------------------------
* ----------------------------------------------------------------------
* 2020-06-16 v0.9 <axel.hahn@iml.unibe.ch>
* 2020-06-16 v0.9 <axel.hahn@iml.unibe.ch>
 
* 2021-03-29 v1.2 <axel.hahn@iml.unibe.ch> support slashes in branch names
* ======================================================================
* ======================================================================
*/
*/
@@ -132,11 +133,11 @@
@@ -132,11 +133,11 @@
$aUriSplit= explode('/', preg_replace('/\?.*$/', '', $_SERVER["REQUEST_URI"]));
$aUriSplit= explode('/', preg_replace('/\?.*$/', '', $_SERVER["REQUEST_URI"]));
array_shift($aUriSplit);
array_shift($aUriSplit);
array_shift($aUriSplit);
array_shift($aUriSplit);
_wd('<pre>$aUriSplit: '.print_r($aUriSplit, 1).'</pre>');
_wd('<pre>$aUriSplit: '.print_r($aUriSplit, 1).'</pre>');
/*
/*
/api/v1/projects/ci/build?auth=123
/api/v1/projects/ci/build/...
$aUriSplit: Array
$aUriSplit: Array
(
(
[0] => v1
[0] => v1
@@ -173,11 +174,14 @@
@@ -173,11 +174,14 @@
$sPrjId = isset($aUriSplit[2]) ? $aUriSplit[2] : false;
$sPrjId = isset($aUriSplit[2]) ? $aUriSplit[2] : false;
$sPrjAction = isset($aUriSplit[3]) ? $aUriSplit[3] : false;
$sPrjAction = isset($aUriSplit[3]) ? $aUriSplit[3] : false;
$sParam4 = isset($aUriSplit[4]) ? $aUriSplit[4] : false;
$sBranch = implode('/', array_slice($aUriSplit, 4));
$sParam5 = isset($aUriSplit[5]) ? $aUriSplit[5] : false;
 
// $sParam4 = isset($aUriSplit[4]) ? $aUriSplit[4] : false;
 
// $sParam5 = isset($aUriSplit[5]) ? $aUriSplit[5] : false;
$sMethod = $_SERVER['REQUEST_METHOD'];
$sMethod = $_SERVER['REQUEST_METHOD'];
_wd('$sPrjId = '.$sPrjId);
_wd('$sPrjId = '.$sPrjId);
_wd('$sPrjAction = '.$sPrjAction);
_wd('$sPrjAction = '.$sPrjAction);
 
_wd('$sBranch = ' . $sBranch);
$oCLog = new logger();
$oCLog = new logger();
// try to init the given project
// try to init the given project
@@ -208,8 +212,8 @@
@@ -208,8 +212,8 @@
switch($sPrjAction){
switch($sPrjAction){
case "build":
case "build":
if ($sParam4){
if ($sBranch){
$aResult=$oProject->setBranchname($sParam4 . ($sParam5 ? '/'.$sParam5 : ''));
$aResult=$oProject->setBranchname($sBranch);
}
}
$sBranchname=$oProject->getBranchname();
$sBranchname=$oProject->getBranchname();
$aRepodata = $oProject->getRemoteBranches(true);
$aRepodata = $oProject->getRemoteBranches(true);
Loading