diff --git a/module/repo/control.php b/module/repo/control.php index 3aa383874d..b8f7974b1d 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -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); diff --git a/module/repo/view/showsynccommit.html.php b/module/repo/view/showsynccommit.html.php index 52d1a20158..796404f3dc 100644 --- a/module/repo/view/showsynccommit.html.php +++ b/module/repo/view/showsynccommit.html.php @@ -28,7 +28,7 @@ $(function(){ var link = createLink('repo', 'ajaxSyncCommit', "repoID="); - var link = createLink('repo', 'ajaxSyncBranchCommit', "repoID=&branch="); + var link = createLink('repo', 'ajaxSyncBranchCommit', "repoID=&branch="); function syncComments() {