* Fix diff empty error

This commit is contained in:
zenggang
2022-02-18 03:26:13 +00:00
parent ef212d58f7
commit 82c5c2472f

View File

@@ -296,6 +296,8 @@ class gitlab
if($toRevision == 'HEAD' and $this->branch) $params['to'] = $this->branch;
$results = $this->fetch($api, $params);
if(!isset($results->diffs)) return array();
foreach($results->diffs as $key => $diff)
{
if($path != '' and strpos($diff->new_path, $path) === false) unset($results->diffs[$key]);