mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
dry_upgrade_changes_lockfile called ensure_read_clone (which syncs the read clone under the _meta-conventions lock then releases it) and ran 'git clone --local --no-hardlinks <read_clone>' OUTSIDE the lock. A concurrent ensure_read_clone -> _sync_read_clone (fetch + hard-reset to origin's default branch) could mutate the read clone's working tree / object db mid-clone, racing the clone and producing an inconsistent or failing probe. Split _probe_lockfile_change into _clone_local_into (the local clone, run under the read-clone lock) + _probe_lockfile_on_clone (the upgrade + git status, run without the lock on the now-independent copy). The probe acquires _ensure_lock_for(slug, '_meta-conventions') — the same lock ensure_read_clone syncs under — and holds it only for the clone step; the upgrade operates on the full --no-hardlinks copy and never touches the read clone, so the lock is released before it to avoid blocking conventions reads for the upgrade duration. The tiny gap between ensure_read_clone releasing the lock and the probe re-acquiring it is safe: any concurrent _sync_read_clone completes under the lock before the probe acquires, so the clone reads a stable state.