* Adjust scm check rule for file tree get.
This commit is contained in:
@@ -2002,7 +2002,7 @@ class repo extends control
|
||||
$repo = $this->repo->getByID($repoID);
|
||||
if($path) $path = helper::safe64Decode($path);
|
||||
|
||||
if($repo->SCM == 'gitlab') return print(json_encode($this->repo->getGitlabFilesByPath($repo, $path, $branch)));
|
||||
if($repo->SCM == 'Gitlab') return print(json_encode($this->repo->getGitlabFilesByPath($repo, $path, $branch)));
|
||||
return print(json_encode($this->repoZen->getViewTree($repo, $path, $branch)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2170,7 +2170,15 @@ class repoModel extends model
|
||||
$service = $this->loadModel('pipeline')->getByID($repo->serviceHost);
|
||||
if($repo->SCM == 'Gitlab')
|
||||
{
|
||||
if($getCodePath) $project = $this->loadModel('gitlab')->apiGetSingleProject($repo->serviceHost, $repo->serviceProject);
|
||||
if($getCodePath)
|
||||
{
|
||||
$project = $this->loadModel('gitlab')->apiGetSingleProject((int)$repo->serviceHost, (int)$repo->serviceProject);
|
||||
if(isset($project->web_url) && $repo->path != $project->web_url)
|
||||
{
|
||||
$repo->path = $project->web_url;
|
||||
$this->dao->update(TABLE_REPO)->set('path')->eq($repo->path)->where('id')->eq($repo->id)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
$repo->path = (!$repo->path && $service) ? sprintf($this->config->repo->{$service->type}->apiPath, $service->url, $repo->serviceProject) : $repo->path;
|
||||
$repo->apiPath = sprintf($this->config->repo->{$service->type}->apiPath, $service->url, $repo->serviceProject);
|
||||
|
||||
Reference in New Issue
Block a user