diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-03 19:54:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-03 19:54:36 +0900 |
| commit | 756e0b9c18af8b2b5887ae1fb265a03187ca9c00 (patch) | |
| tree | f9db28d2bbe39e4756521bc29fa50d5782322956 /crates/mozart/src/commands/remove.rs | |
| parent | 7057b2332cbad8934c3bfcded70566ce8dc16963 (diff) | |
| download | php-mozart-756e0b9c18af8b2b5887ae1fb265a03187ca9c00.tar.gz php-mozart-756e0b9c18af8b2b5887ae1fb265a03187ca9c00.tar.zst php-mozart-756e0b9c18af8b2b5887ae1fb265a03187ca9c00.zip | |
fix(update): unlock new-package deps via repo requires for --with-deps
`expand_with_direct_dependencies` only walked the lock map, so an
allow-listed package not yet in the lock (a freshly added root require)
contributed nothing to the unlock cascade. The resolver then kept
transitive deps pinned to their lock versions and bailed when the new
package's require could not be satisfied. Mirror Composer's
`PoolBuilder::loadPackage` by also walking inline / composer-repo
require lists for not-yet-locked packages.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/remove.rs')
| -rw-r--r-- | crates/mozart/src/commands/remove.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/mozart/src/commands/remove.rs b/crates/mozart/src/commands/remove.rs index dc20a21..3ffe04a 100644 --- a/crates/mozart/src/commands/remove.rs +++ b/crates/mozart/src/commands/remove.rs @@ -335,14 +335,20 @@ pub async fn execute( .map(|s| s.trim().to_lowercase()) .collect(); + let repo_requires = super::update::collect_repo_requires(&raw.repositories); let allow_list = if args.no_update_with_dependencies { // Only the removed packages themselves are freed removed_names } else if with_all_deps { - super::update::expand_with_all_dependencies(removed_names, lock) + super::update::expand_with_all_dependencies(removed_names, lock, &repo_requires) } else { // Default: freed packages + their direct dependencies - super::update::expand_with_direct_dependencies(removed_names, lock, &IndexSet::new()) + super::update::expand_with_direct_dependencies( + removed_names, + lock, + &IndexSet::new(), + &repo_requires, + ) }; // For --minimal-changes, additionally pin packages beyond the allow list |
