1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00

Fix parsing "branch-version"

This commit is contained in:
Nicolas Grekas 2020-10-13 15:16:39 +02:00
parent fec3c6a4e9
commit 4feed8b85c
3 changed files with 17 additions and 4 deletions

View file

@ -167,7 +167,7 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
// use the branch-version as the package version if available
if (!isset($package['version']) && isset($package['extra']['branch-version'])) {
$package['version'] = preg_replace('{(\.x)?(-dev)?$}', '.x-dev', $package['extra']['branch-version']);
$package['version'] = preg_replace('{(\.x)?(-dev)?$}', '', $package['extra']['branch-version']).'.x-dev';
}
// carry over the root package version if this path repo is in the same git repository as root package