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

Try to load packages from lock file only and avoid loading other versions for pinned packages

This commit is contained in:
Jordi Boggiano 2020-01-15 15:34:33 +01:00
parent de189c1b80
commit e50f78043a
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
5 changed files with 45 additions and 32 deletions

View file

@ -20,6 +20,7 @@ use Composer\Package\Version\VersionParser;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\LockArrayRepository;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Test\DependencyResolver\PoolTest;
@ -147,6 +148,12 @@ class RepositorySet
{
$poolBuilder = new PoolBuilder(array($this, 'isPackageAcceptable'), $this->rootRequires);
foreach ($this->repositories as $repo) {
if ($repo instanceof InstalledRepositoryInterface) {
throw new \LogicException('The pool can not accept packages from an installed repository');
}
}
return $this->pool = $poolBuilder->buildPool($this->repositories, $this->rootAliases, $this->rootReferences, $request);
}