From d1dfd394c19db6bdd979bcac7fea0c31077e34af Mon Sep 17 00:00:00 2001 From: Helmut Hummel Date: Sat, 24 Oct 2020 21:34:34 +0200 Subject: [PATCH] Correctly avoid partial updates in require commands The installer does not support partial updates, when no lock file is present. The check in require command to prevent a partial update however does not check whether a lock file is present, but whether a lock file should be written, which most likely always is true. This check is now changed to check if a lock file is actually present. --- src/Composer/Command/RequireCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 03ac10240..415de9fe7 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -314,7 +314,7 @@ EOT // if no lock is present, or the file is brand new, we do not do a // partial update as this is not supported by the Installer - if (!$this->firstRequire && $composer->getConfig()->get('lock')) { + if (!$this->firstRequire && $composer->getLocker()->isLocked()) { $install->setUpdateAllowList(array_keys($requirements)); }