* Fix bug #18920,18919,18918.

This commit is contained in:
caoyanyi
2022-01-24 08:36:47 +00:00
parent 39022c7ef3
commit da20e9dfa8
2 changed files with 11 additions and 4 deletions
+11 -2
View File
@@ -1489,10 +1489,19 @@ class gitlabModel extends model
* @access public
* @return object
*/
public function apiGetBranches($gitlabID, $projectID)
public function apiGetBranches($gitlabID, $projectID, $pager = null)
{
$url = sprintf($this->getApiRoot($gitlabID), "/projects/{$projectID}/repository/branches");
return json_decode(commonModel::http($url));
$allResults = array();
for($page = 1; true; $page++)
{
$results = json_decode(commonModel::http($url . "&&page={$page}&per_page=100"));
if(!is_array($results)) break;
if(!empty($results)) $allResults = array_merge($allResults, $results);
if(count($results)<100) break;
}
return $allResults;
}
/**