1
0
Fork 0

Fixed undefined variable when no branch match.

Closes #756
pull/757/head
Christophe Coevoet 2012-06-02 00:48:46 +03:00
parent b3c395b8d2
commit b634659695
1 changed files with 2 additions and 0 deletions

View File

@ -159,6 +159,8 @@ class RootPackageLoader extends ArrayLoader
// try to fetch current version from git branch // try to fetch current version from git branch
if (0 === $this->process->execute('git branch --no-color --no-abbrev -v', $output)) { if (0 === $this->process->execute('git branch --no-color --no-abbrev -v', $output)) {
$branches = array(); $branches = array();
$isFeatureBranch = true;
$version = null;
foreach ($this->process->splitLines($output) as $branch) { foreach ($this->process->splitLines($output) as $branch) {
if ($branch && preg_match('{^(?:\* ) *(?:[^/ ]+?/)?(\S+|\(no branch\)) *([a-f0-9]+) .*$}', $branch, $match)) { if ($branch && preg_match('{^(?:\* ) *(?:[^/ ]+?/)?(\S+|\(no branch\)) *([a-f0-9]+) .*$}', $branch, $match)) {
if ($match[1] === '(no branch)') { if ($match[1] === '(no branch)') {