From a9811d2bfe7ec133f5c85c94f978bd4e18edcbf9 Mon Sep 17 00:00:00 2001 From: Guan Xiying Date: Tue, 27 Jul 2021 10:39:18 +0800 Subject: [PATCH] * Trim repo->prefix of gitlab repo. --- module/repo/control.php | 2 +- module/repo/model.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index bf3114ffb6..84b8379a9d 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -450,7 +450,7 @@ class repo extends control $revisions = $this->repo->getCommits($repo, $path, $revision, $logType, $pager); /* Synchronous commit only in root path. */ - if(!$repo->synced and strpos($repo->SCM, 'Git') !== false and empty($path) and $infos and empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID&branch=" . base64_encode($this->cookie->repoBranch))); + if(strpos($repo->SCM, 'Git') !== false and empty($path) and $infos and empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID&branch=" . base64_encode($this->cookie->repoBranch))); /* Set committers. */ $commiters = $this->loadModel('user')->getCommiters(); diff --git a/module/repo/model.php b/module/repo/model.php index 3e7e8c0034..1580e3739d 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -429,7 +429,7 @@ class repoModel extends model public function getCommits($repo, $entry, $revision = 'HEAD', $type = 'dir', $pager = null, $begin = 0, $end = 0) { $entry = ltrim($entry, '/'); - $entry = $repo->prefix . (empty($entry) ? '' : '/' . $entry); + if($repo->SCM != 'Gitlab') $entry = $repo->prefix . (empty($entry) ? '' : '/' . $entry); $repoID = $repo->id; $revisionTime = $this->dao->select('time')->from(TABLE_REPOHISTORY)->alias('t1') @@ -442,6 +442,7 @@ class repoModel extends model ->fetch('time'); $historyIdList = array(); + if($entry != '/' and !empty($entry)) { $historyIdList = $this->dao->select('DISTINCT t2.id')->from(TABLE_REPOFILES)->alias('t1')