* Finish task #44796.
This commit is contained in:
@@ -369,8 +369,8 @@ class job extends control
|
||||
public function ajaxGetRefList($repoID)
|
||||
{
|
||||
$repo = $this->loadModel('repo')->getRepoByID($repoID);
|
||||
if($repo->SCM != 'Gitlab') $this->send(array('result' => 'fail'));
|
||||
$refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitlab, $repo->project);
|
||||
if($repo->SCM == 'Gitlab') $refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitlab, $repo->project);
|
||||
if($repo->SCM != 'Gitlab') $refList = $this->repo->getBranches($repo, true);
|
||||
$this->send(array('result' => 'success', 'refList' => $refList));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ $(document).ready(function()
|
||||
{
|
||||
if(data.result == 'success')
|
||||
{
|
||||
if(data.type == 'gitlab')
|
||||
if(data.type.indexOf('git') != -1)
|
||||
{
|
||||
$('.reference').show();
|
||||
$('.svn-fields').addClass('hidden');
|
||||
|
||||
@@ -416,15 +416,23 @@ class repoModel extends model
|
||||
/**
|
||||
* Get git branches.
|
||||
*
|
||||
* @param object $repo
|
||||
* @param object $repo
|
||||
* @param bool $printLabel
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBranches($repo)
|
||||
public function getBranches($repo, $printLabel = false)
|
||||
{
|
||||
$this->scm = $this->app->loadClass('scm');
|
||||
$this->scm->setEngine($repo);
|
||||
return $this->scm->branch();
|
||||
$branches = $this->scm->branch();
|
||||
|
||||
if($printLabel)
|
||||
{
|
||||
foreach($branches as &$branch) $branch = 'Branch::' . $branch;
|
||||
}
|
||||
|
||||
return $branches;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user