1
0
Fork 0

Fix 9999999-dev showing on composer show when no branch alias is defined for the default branch, fixes #10260

pull/10262/head
Jordi Boggiano 2021-11-08 10:43:25 +01:00
parent 5b47fa1896
commit 9f433aba76
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 0 deletions

View File

@ -604,6 +604,11 @@ EOT
}
$matches = $pool->whatProvides($name, $constraint);
foreach ($matches as $index => $package) {
// avoid showing the 9999999-dev alias if the default branch has no branch-alias set
if ($package instanceof AliasPackage && $package->getVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) {
$package = $package->getAliasOf();
}
// select an exact match if it is in the installed repo and no specific version was required
if (null === $version && $installedRepo->hasPackage($package)) {
$matchedPackage = $package;