* [bug#50302,0.3h] adjust branch commit sync logic.

This commit is contained in:
caoyanyi
2024-05-28 15:47:06 +08:00
parent 8e60166dfc
commit 06ea240028
3 changed files with 25 additions and 18 deletions
+18 -17
View File
@@ -505,23 +505,24 @@ class repo extends control
/* Synchronous commit only in root path. */
if(in_array($repo->SCM, $this->config->repo->gitTypeList) && $repo->SCM != 'Gitlab' && empty($path) && $infos && empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID&branch=" . helper::safe64Encode(base64_encode($this->cookie->repoBranch))));
$this->view->title = $this->lang->repo->common;
$this->view->repo = $repo;
$this->view->revisions = $revisions;
$this->view->revision = $revision;
$this->view->lastRevision = $lastRevision;
$this->view->infos = $infos;
$this->view->repoID = $repoID;
$this->view->branches = $branches;
$this->view->tags = $tags;
$this->view->branchID = $branchID;
$this->view->objectID = $objectID;
$this->view->pager = $pager;
$this->view->path = urldecode($path);
$this->view->logType = $type;
$this->view->cloneUrl = $this->repo->getCloneUrl($repo);
$this->view->repoPairs = $this->repo->getRepoPairs($this->app->tab, $objectID);
$this->view->branchOrTag = $branchOrTag;
$this->view->title = $this->lang->repo->common;
$this->view->repo = $repo;
$this->view->revisions = $revisions;
$this->view->revision = $revision;
$this->view->lastRevision = $lastRevision;
$this->view->infos = $infos;
$this->view->repoID = $repoID;
$this->view->branches = $branches;
$this->view->tags = $tags;
$this->view->branchID = $branchID;
$this->view->base64BranchID = $base64BranchID;
$this->view->objectID = $objectID;
$this->view->pager = $pager;
$this->view->path = urldecode($path);
$this->view->logType = $type;
$this->view->cloneUrl = $this->repo->getCloneUrl($repo);
$this->view->repoPairs = $this->repo->getRepoPairs($this->app->tab, $objectID);
$this->view->branchOrTag = $branchOrTag;
$this->display();
}
+5
View File
@@ -282,3 +282,8 @@ window.afterPageUpdate = function()
});
}, 200);
};
$(function()
{
if(base64BranchID) $.get($.createLink('repo', 'ajaxSyncBranchCommit', 'repoID=' + repo.id + '&branch=' + base64BranchID));
});
+2 -1
View File
@@ -13,6 +13,7 @@ declare(strict_types=1);
namespace zin;
jsVar('copied', $lang->repo->copied);
jsVar('base64BranchID', $base64BranchID);
$module = $app->tab == 'devops' ? 'repo' : $app->tab;
dropmenu
@@ -212,7 +213,7 @@ toolbar
(
a(
set::className('last-sync-time'),
set::href($lastRevision->link),
empty($lastRevision->link) ? null : set::href($lastRevision->link),
$lang->repo->notice->lastSyncTime . (isset($lastRevision->time) ? date('m-d H:i', strtotime($lastRevision->time)) : date('m-d H:i'))
),
!in_array($repo->SCM, $config->repo->notSyncSCM) ? item(set($refreshItem)) : null,