Merge branch 'master' into 'devops_bug'

# Conflicts:
#   module/repo/control.php
This commit is contained in:
李玉春
2022-02-24 00:39:43 +00:00
+4 -6
View File
@@ -835,18 +835,16 @@ class repo extends control
*/
public function download($repoID, $path, $fromRevision = 'HEAD', $toRevision = '', $type = 'file', $isBranchOrTag = false)
{
$fromRevision = str_replace('*', '-', $fromRevision);
$toRevision = str_replace('*', '-', $toRevision);
if($this->get->repoPath) $path = $this->get->repoPath;
$entry = $this->repo->decodePath($path);
$repo = $this->repo->getRepoByID($repoID);
if($isBranchOrTag)
{
$fromRevision = urldecode(helper::safe64Decode($fromRevision));
$toRevision = urldecode(helper::safe64Decode($toRevision));
}
if($this->get->repoPath) $path = $this->get->repoPath;
$entry = $this->repo->decodePath($path);
$repo = $this->repo->getRepoByID($repoID);
$this->commonAction($repoID);
$this->scm->setEngine($repo);
$content = $type == 'file' ? $this->scm->cat($entry, $fromRevision) : $this->scm->diff($entry, $fromRevision, $toRevision, 'patch', $isBranchOrTag ? 'isBranchOrTag': '');