From 902a153741e04043a40d94362973d073309f768d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 6 Jun 2023 14:02:29 +0200 Subject: [PATCH] Fix regression in edge cases where root package gets added to a repository already during the install process, fixes #11495 --- src/Composer/Package/Locker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index e03b6bd6a..f832e797c 100644 --- a/src/Composer/Package/Locker.php +++ b/src/Composer/Package/Locker.php @@ -515,7 +515,7 @@ class Locker if ($includeDev === true) { $sets[] = ['repo' => $this->getLockedRepository(true), 'method' => 'getDevRequires', 'description' => 'Required (in require-dev)']; } - $rootRepo = new RootPackageRepository($package); + $rootRepo = new RootPackageRepository(clone $package); foreach ($sets as $set) { $installedRepo = new InstalledRepository([$set['repo'], $rootRepo]);