From cccdce42f6eb5c21179bf7b2fbd482a7d29c3b9d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 22:39:17 +0900 Subject: fix(update): wire up the bare-keyword mirrors mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `update lock`, `update nothing`, and `update mirrors` were treated as ordinary full updates: the resolver picked the highest matching version of every root require and the install step rewrote refs from the repository, masquerading transport metadata refreshes as content changes (and accepting brand-new root requires the lock had never seen). Mirror Composer's `setUpdateMirrors(true)` flow: - Detect the bare-keyword form and skip composer.json's require / require-dev entirely; require each locked package by exact version instead. This drops fresh root requires Mozart shouldn't yet honor and pins existing ones to their lock version. - After lockfile generation, walk each new entry and copy the OLD lock's source/dist reference back when the source/dist *type* matches, mirroring `LockTransaction::updateMirrorAndUrls`. URL and mirrors update; ref stays put — so a repo rename or mirror flip emits no Update operation, but a real type change (`hg` → `git`) still does. --- crates/mozart/tests/installer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/mozart/tests') diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index 189a7c9..f304b72 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -388,8 +388,8 @@ installer_fixture!(update_installed_alias); installer_fixture!(update_installed_alias_dry_run); installer_fixture!(update_installed_reference); installer_fixture!(update_installed_reference_dry_run); -installer_fixture!(update_mirrors_changes_url, ignore); -installer_fixture!(update_mirrors_fails_with_new_req, ignore); +installer_fixture!(update_mirrors_changes_url); +installer_fixture!(update_mirrors_fails_with_new_req); installer_fixture!(update_no_dev_still_resolves_dev); installer_fixture!(update_no_install); installer_fixture!(update_package_present_in_lock_but_not_at_all_in_remote); -- cgit v1.3.1