diff --git a/module/git/model.php b/module/git/model.php index 417765d12a..7b6b5e8fbf 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -43,19 +43,6 @@ class gitModel extends model */ public $users = array(); - /** - * Construct function. - * - * @access public - * @return void - */ - public function __construct() - { - parent::__construct(); - $this->loadModel('action'); - $this->loadModel('repo'); - } - /** * 执行定时任务同步提交信息。 * Sync commit info by cron. diff --git a/module/repo/model.php b/module/repo/model.php index 8bb51818ef..1a1c8621fb 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -1259,7 +1259,7 @@ class repoModel extends model $scm->setEngine($repo); $logs = $scm->log('', $lastInDB ? $lastInDB->revision : 0); - if(empty($logs)) return false; + if(empty($logs)) return array(); /* Process logs. */ $logs = array_reverse($logs, true); @@ -1656,6 +1656,7 @@ class repoModel extends model $this->saveObjectToPms($objects, $action, $changes); if(isset($this->app->user)) $this->app->user->account = $account; + return !dao::isError(); } /** @@ -1793,7 +1794,7 @@ class repoModel extends model * @access public * @return string */ - public function buildURL(string $methodName, string $url, int $revision, string $scm = 'svn'): string + public function buildURL(string $methodName, string $url, string $revision, string $scm = 'svn'): string { $buildedURL = helper::createLink($scm, $methodName, "url=&revision=$revision", 'html'); $buildedURL .= strpos($buildedURL, '?') === false ? '?' : '&';