From 2d49090ffda947b24a909291e3f7aa3e998b007b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 13 Apr 2012 02:35:52 +0200 Subject: [PATCH] Make sure branches have proper .x suffix so that they can be parsed properly --- src/Composer/Package/Loader/ArrayLoader.php | 2 +- src/Composer/Repository/VcsRepository.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index f3bd0d5b7..b44d6b950 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -151,7 +151,7 @@ class ArrayLoader } $package->setAlias($validatedTargetBranch); - $package->setPrettyAlias($targetBranch); + $package->setPrettyAlias(preg_replace('{(\.9{7})+}', '.x', $validatedTargetBranch)); break; } } diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php index 00499b5bb..b70e7c09d 100644 --- a/src/Composer/Repository/VcsRepository.php +++ b/src/Composer/Repository/VcsRepository.php @@ -200,7 +200,7 @@ class VcsRepository extends ArrayRepository if ('dev-' === substr($parsedBranch, 0, 4) || '9999999-dev' === $parsedBranch) { $data['version'] = 'dev-' . $data['version']; } else { - $data['version'] = $data['version'] . '-dev'; + $data['version'] = preg_replace('{(\.9{7})+}', '.x', $parsedBranch); } if ($verbose) {