* fix for branch with '-'.

This commit is contained in:
z
2020-08-28 09:36:28 +08:00
parent e4ebc510ed
commit 652f1becdb
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -325,7 +325,7 @@ class repo extends control
$logType = 'dir';
$revisions = $this->repo->getCommits($repo, $path, $revision, $logType, $pager);
if($repo->SCM == 'Git' and $infos and empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&branch={$this->cookie->repoBranch}"));
if($repo->SCM == 'Git' and $infos and empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&branch=" . base64_encode($this->cookie->repoBranch)));
$commiters = $this->loadModel('user')->getCommiters();
foreach($infos as $info) $info->committer = zget($commiters, $info->account, $info->account);
foreach($revisions as $log) $log->committer = zget($commiters, $log->committer, $log->committer);
@@ -703,6 +703,7 @@ class repo extends control
{
$this->repo->setMenu($this->repos, $repoID);
if($repoID == 0) $repoID = $this->session->repoID;
if($branch) $branch = base64_decode($branch);
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->showSyncCommit;
$this->view->position[] = $this->lang->repo->showSyncCommit;
@@ -819,6 +820,7 @@ class repo extends control
$repo = $this->repo->getRepoByID($repoID);
if(empty($repo)) die();
if($repo->SCM != 'Git') die('finish');
if($branch) $branch = base64_decode($branch);
$this->scm->setEngine($repo);
+1 -1
View File
@@ -28,7 +28,7 @@ $(function(){
<?php if(empty($branch)):?>
var link = createLink('repo', 'ajaxSyncCommit', "repoID=<?php echo $repoID?>");
<?php else:?>
var link = createLink('repo', 'ajaxSyncBranchCommit', "repoID=<?php echo $repoID?>&branch=<?php echo $branch;?>");
var link = createLink('repo', 'ajaxSyncBranchCommit', "repoID=<?php echo $repoID?>&branch=<?php echo base64_encode($branch);?>");
<?php endif;?>
function syncComments()
{