Merge branch 'devops22_zenggang' into 'master'

修复diff为空时报错提示

See merge request easycorp/zentaopms!1848
This commit is contained in:
李玉春
2022-02-18 06:43:58 +00:00
+2
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]);