Always clone root package before adding it to a RootPackageRepo to avoid issues with plugins, fixes #10940
parent
336a0d20c6
commit
b195f383f2
|
@ -59,7 +59,7 @@ class BaseDependencyCommand extends BaseCommand
|
|||
|
||||
$platformOverrides = $composer->getConfig()->get('platform') ?: array();
|
||||
$installedRepo = new InstalledRepository(array(
|
||||
new RootPackageRepository($composer->getPackage()),
|
||||
new RootPackageRepository(clone $composer->getPackage()),
|
||||
$composer->getRepositoryManager()->getLocalRepository(),
|
||||
new PlatformRepository(array(), $platformOverrides),
|
||||
));
|
||||
|
|
|
@ -80,7 +80,7 @@ EOT
|
|||
$requires[$require] = array($link);
|
||||
}
|
||||
|
||||
$installedRepo = new InstalledRepository(array($installedRepo, new RootPackageRepository($composer->getPackage())));
|
||||
$installedRepo = new InstalledRepository(array($installedRepo, new RootPackageRepository(clone $composer->getPackage())));
|
||||
foreach ($installedRepo->getPackages() as $package) {
|
||||
if (in_array($package->getName(), $removePackages, true)) {
|
||||
continue;
|
||||
|
|
|
@ -167,7 +167,7 @@ EOT
|
|||
|
||||
if ($composer) {
|
||||
return array_merge(
|
||||
array(new RootPackageRepository($composer->getPackage())), // root package
|
||||
array(new RootPackageRepository(clone $composer->getPackage())), // root package
|
||||
array($composer->getRepositoryManager()->getLocalRepository()), // installed packages
|
||||
$composer->getRepositoryManager()->getRepositories() // remotes
|
||||
);
|
||||
|
|
|
@ -167,7 +167,7 @@ EOT
|
|||
$lockedRepo = null;
|
||||
|
||||
if ($input->getOption('self')) {
|
||||
$package = $this->getComposer()->getPackage();
|
||||
$package = clone $this->getComposer()->getPackage();
|
||||
if ($input->getOption('name-only')) {
|
||||
$io->write($package->getName());
|
||||
|
||||
|
|
Loading…
Reference in New Issue