From 6dd69c055aa0788d64957848e5ea91cbc1b9ca12 Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Thu, 30 Jun 2022 02:21:03 +0000 Subject: [PATCH] * Fix bug #23945. --- lib/scm/gitrepo.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 93261cdcac..2b691eef17 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -107,6 +107,12 @@ class GitRepo $cmd = escapeCmd("$this->client tag --sort=taggerdate"); $list = execCmd($cmd . ' 2>&1', 'array', $result); if($result) return array(); + + foreach($list as $key => $tag) + { + if(!$tag) unset($list[$key]); + } + return $list; } @@ -139,7 +145,7 @@ class GitRepo } asort($branches); - $branches = array($defaultBranch => $defaultBranch) + $branches; + if($defaultBranch) $branches = array($defaultBranch => $defaultBranch) + $branches; return $branches; }