From b6346596958b7edf2a6103ee0f7cc82b2f216ba7 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 2 Jun 2012 00:48:46 +0300 Subject: [PATCH] Fixed undefined variable when no branch match. Closes #756 --- src/Composer/Package/Loader/RootPackageLoader.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Composer/Package/Loader/RootPackageLoader.php b/src/Composer/Package/Loader/RootPackageLoader.php index 725cfefda..b82a19bae 100644 --- a/src/Composer/Package/Loader/RootPackageLoader.php +++ b/src/Composer/Package/Loader/RootPackageLoader.php @@ -159,6 +159,8 @@ class RootPackageLoader extends ArrayLoader // try to fetch current version from git branch if (0 === $this->process->execute('git branch --no-color --no-abbrev -v', $output)) { $branches = array(); + $isFeatureBranch = true; + $version = null; foreach ($this->process->splitLines($output) as $branch) { if ($branch && preg_match('{^(?:\* ) *(?:[^/ ]+?/)?(\S+|\(no branch\)) *([a-f0-9]+) .*$}', $branch, $match)) { if ($match[1] === '(no branch)') {