From 381fcb248ac827a3bf34e006b5c7aaaf76208d76 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 7 Dec 2011 11:44:03 +0100 Subject: [PATCH] Allow parsing of branches with invalid names but explicit versions in composer.json --- src/Composer/Repository/VcsRepository.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php index e17883009..b69253b35 100644 --- a/src/Composer/Repository/VcsRepository.php +++ b/src/Composer/Repository/VcsRepository.php @@ -120,22 +120,27 @@ class VcsRepository extends ArrayRepository $this->addPackage($loader->load($this->preProcess($driver, $data, $identifier))); } elseif ($debug) { - echo 'Skipped tag '.$tag.', invalid name or no composer file'.PHP_EOL; + echo 'Skipped tag '.$tag.', '.($parsedTag ? 'no composer file was found' : 'invalid name').PHP_EOL; } } foreach ($driver->getBranches() as $branch => $identifier) { $parsedBranch = $this->validateBranch($versionParser, $branch); - if ($parsedBranch && $driver->hasComposerFile($identifier)) { + if ($driver->hasComposerFile($identifier)) { $data = $driver->getComposerInformation($identifier); // manually versioned package if (isset($data['version'])) { $data['version_normalized'] = $versionParser->normalize($data['version']); - } else { + } elseif ($parsedBranch) { // auto-versionned package, read value from branch name $data['version'] = $branch; $data['version_normalized'] = $parsedBranch; + } else { + if ($debug) { + echo 'Skipped branch '.$branch.', invalid name and no composer file was found'.PHP_EOL; + } + continue; } // make sure branch packages have a -dev flag @@ -160,7 +165,7 @@ class VcsRepository extends ArrayRepository $this->addPackage($loader->load($this->preProcess($driver, $data, $identifier))); } elseif ($debug) { - echo 'Skipped branch '.$branch.', invalid name or no composer file'.PHP_EOL; + echo 'Skipped branch '.$branch.', no composer file was found'.PHP_EOL; } } }