* Trim repo->prefix of gitlab repo.

This commit is contained in:
Guan Xiying
2021-07-27 10:39:18 +08:00
parent c68a5aea7a
commit a9811d2bfe
2 changed files with 3 additions and 2 deletions

View File

@@ -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();

View File

@@ -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')