1
0
Fork 0

Avoid setting the update whitelist in require command on newly created files and when the lock file is disabled

pull/8531/head
Jordi Boggiano 2020-01-17 11:33:47 +01:00
parent e6749d8717
commit 257d2ce889
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 1 deletions

View File

@ -236,7 +236,6 @@ EOT
->setClassMapAuthoritative($authoritative)
->setApcuAutoloader($apcu)
->setUpdate(true)
->setUpdateWhitelist(array_keys($requirements))
->setWhitelistTransitiveDependencies($input->getOption('update-with-dependencies'))
->setWhitelistAllDependencies($input->getOption('update-with-all-dependencies'))
->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
@ -244,6 +243,12 @@ EOT
->setPreferLowest($input->getOption('prefer-lowest'))
;
// 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->newlyCreated && $composer->getConfig()->get('lock')) {
$install->setUpdateWhitelist(array_keys($requirements));
}
$status = $install->run();
if ($status !== 0) {
$this->revertComposerFile(false);