* code for task #6858.

This commit is contained in:
wangyidong
2020-02-26 13:42:26 +08:00
parent c00a40a60a
commit 990ef6699a
11 changed files with 142 additions and 163 deletions
+2 -4
View File
@@ -37,10 +37,9 @@ class git extends control
$path = helper::safe64Decode($path);
if(common::hasPriv('repo', 'diff'))
{
$repos = $this->loadModel('repo')->getAllRepos();
$repos = $this->loadModel('repo')->getListBySCM('Git', 'haspriv');
foreach($repos as $repo)
{
if($repo->SCM != 'Git') continue;
if(strpos($path, $repo->path) === 0)
{
$entry = $this->repo->encodePath(str_replace($repo->path, '', $path));
@@ -72,10 +71,9 @@ class git extends control
$path = helper::safe64Decode($path);
if(common::hasPriv('repo', 'view'))
{
$repos = $this->loadModel('repo')->getList();
$repos = $this->loadModel('repo')->getListBySCM('Git', 'haspriv');
foreach($repos as $repo)
{
if($repo->SCM != 'Git') continue;
if(strpos($path, $repo->path) === 0)
{
$entry = $this->repo->encodePath(str_replace($repo->path, '', $path));