diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 550ae4e754..297adc4337 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -125,10 +125,11 @@ class GitRepo $list = execCmd($cmd . ' 2>&1', 'array', $result); if($result) return array(); + $branches = array(); foreach($list as $localBranch) { - if($localBranch[0] == '*') $localBranch = substr($localBranch, 1); + if(substr($localBranch, 0, 1) == '*') $localBranch = substr($localBranch, 1); $localBranch = trim($localBranch); if(empty($localBranch))continue;