From 042a8c212801aeac42b7a41b42cd1185ae28123a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 10 Jan 2024 13:33:49 +0100 Subject: [PATCH] Ensure dist url/type/checksum remain the same when doing lock hash updates, refs #11787 --- src/Composer/DependencyResolver/LockTransaction.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/DependencyResolver/LockTransaction.php b/src/Composer/DependencyResolver/LockTransaction.php index 92eb147f5..ea84771b9 100644 --- a/src/Composer/DependencyResolver/LockTransaction.php +++ b/src/Composer/DependencyResolver/LockTransaction.php @@ -111,6 +111,9 @@ class LockTransaction extends Transaction if ($package->getName() === $presentPackage->getName() && $package->getVersion() === $presentPackage->getVersion()) { if ($presentPackage->getSourceReference() && $presentPackage->getSourceType() === $package->getSourceType()) { $package->setSourceDistReferences($presentPackage->getSourceReference()); + $package->setDistUrl($presentPackage->getDistUrl()); + $package->setDistType($presentPackage->getDistType()); + $package->setDistSha1Checksum($presentPackage->getDistSha1Checksum()); } if ($presentPackage->getReleaseDate() !== null && $package instanceof Package) { $package->setReleaseDate($presentPackage->getReleaseDate());