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) {