1
0
Fork 0

Make sure mirror update fails if no lock file is present

pull/9519/head
Jordi Boggiano 2020-11-26 11:28:17 +01:00
parent 2d025dce05
commit e857a8216c
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 4 additions and 6 deletions

View File

@ -367,12 +367,10 @@ class Installer
// doing a full update
}
if ($this->updateAllowList) {
if (!$lockedRepository) {
$this->io->writeError('<error>Cannot update only a partial set of packages without a lock file present.</error>', true, IOInterface::QUIET);
if (($this->updateAllowList || $this->updateMirrors) && !$lockedRepository) {
$this->io->writeError('<error>Cannot update ' . ($this->updateMirrors ? 'lock file information' : 'only a partial set of packages') . ' without a lock file present. Run `composer update` to generate a lock file.</error>', true, IOInterface::QUIET);
return 1;
}
return 1;
}
$this->io->writeError('<info>Loading composer repositories with package information</info>');

View File

@ -31,7 +31,7 @@ Partial update without lock file should error
--RUN--
update b/unstable
--EXPECT-OUTPUT--
Cannot update only a partial set of packages without a lock file present.
Cannot update only a partial set of packages without a lock file present. Run `composer update` to generate a lock file.
--EXPECT-EXIT-CODE--
1
--EXPECT--