* Fix error and add unit testcase.

This commit is contained in:
liyuchun
2021-12-08 15:09:32 +08:00
parent 0de19226e5
commit 568b618199
2 changed files with 28 additions and 1 deletions
+6 -1
View File
@@ -217,7 +217,10 @@ class gitlab
$count = $count == 0 ? '' : "-n $count";
$list = $this->getCommitsByPath($path, $fromRevision, $toRevision);
foreach($list as $commit) $commit->diffs = $this->getFilesByCommit($commit->id);
foreach($list as $commit)
{
if(isset($commit->id)) $commit->diffs = $this->getFilesByCommit($commit->id);
}
return $this->parseLog($list);
}
@@ -653,6 +656,7 @@ class gitlab
{
$results = $this->fetch($api, $params);
$params->page ++;
if(!is_array($results)) $results = array();
$allResults = $allResults + $results;
if(count($results) < 100) break;
}
@@ -748,6 +752,7 @@ class gitlab
$i = 0;
foreach($logs as $commit)
{
if(!isset($commit->id)) continue;
$parsedLog = new stdclass();
$parsedLog->revision = $commit->id;
$parsedLog->committer = $commit->committer_name;