* fix bug #12050.
This commit is contained in:
@@ -501,7 +501,8 @@ class gitlab
|
||||
if($version)
|
||||
{
|
||||
$lastCommit = $this->getSingleCommit($version);
|
||||
if(empty($lastCommit)) return array();
|
||||
if(!isset($lastCommit->committed_date)) return array('commits' => array(), 'files' => array());
|
||||
|
||||
$params['until'] = $lastCommit->committed_date;
|
||||
}
|
||||
|
||||
@@ -644,7 +645,13 @@ class gitlab
|
||||
$api = ltrim($api, '/');
|
||||
$api = $this->root . $api . '?' . http_build_query($params);
|
||||
|
||||
$response = file_get_contents($api);
|
||||
$response = commonModel::http($api);
|
||||
if(!empty(commonModel::$requestErrors))
|
||||
{
|
||||
commonModel::$requestErrors = array();
|
||||
return array();
|
||||
}
|
||||
|
||||
return json_decode($response);
|
||||
}
|
||||
|
||||
|
||||
@@ -867,7 +867,7 @@ class repo extends control
|
||||
set_time_limit(0);
|
||||
$repo = $this->repo->getRepoByID($repoID);
|
||||
if(empty($repo)) die();
|
||||
//if($repo->synced) die('finish');
|
||||
if($repo->synced) die('finish');
|
||||
|
||||
$this->commonAction($repoID);
|
||||
$this->scm->setEngine($repo);
|
||||
|
||||
@@ -281,15 +281,18 @@ class repoModel extends model
|
||||
$repo = $this->getRepoByID($id);
|
||||
|
||||
$data = fixer::input('post')
|
||||
->setIf($this->post->SCM == 'Gitlab', 'password', $this->post->gitlabToken)
|
||||
->setIf($this->post->SCM == 'Gitlab', 'client', $this->post->gitlabHost)
|
||||
->setIf($this->post->SCM == 'Gitlab', 'extra', $this->post->gitlabProject)
|
||||
->setDefault('client', 'svn')
|
||||
->setDefault('prefix', $repo->prefix)
|
||||
->setDefault('product', '')
|
||||
->setIF($this->post->path != $repo->path, 'synced', 0)
|
||||
->skipSpecial('path,client,account,password')
|
||||
->join('product', ',')
|
||||
->get();
|
||||
|
||||
if($this->post->SCM == 'Gitlab') $data->path = sprintf($this->config->repo->gitlab->apiPath, $data->gitlabHost, $this->post->gitlabProject);
|
||||
if($data->path != $repo->path) $data->synced = 0;
|
||||
|
||||
$data->acl = empty($data->acl) ? '' : json_encode($data->acl);
|
||||
|
||||
@@ -313,7 +316,7 @@ class repoModel extends model
|
||||
$this->dao->update(TABLE_REPO)->data($data, $skip = 'gitlabHost,gitlabToken,gitlabProject')
|
||||
->batchCheck($this->config->repo->edit->requiredFields, 'notempty')
|
||||
->checkIF($data->SCM == 'Subversion', $this->config->repo->svn->requiredFields, 'notempty')
|
||||
->checkIF($data->SCM == 'GitLab', 'gitlabProject', 'notempty')
|
||||
->checkIF($data->SCM == 'GitLab', 'extra', 'notempty')
|
||||
->autoCheck()
|
||||
->where('id')->eq($id)->exec();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user