Don't panic in uv export --frozen when the lockfile is outdated (#16407)

Provide a good error message when the discovered workspace members
mismatch with the locked workspace members in `uv export --frozen`,
instead of panicking.

Fixes #16406
This commit is contained in:
konsti 2025-10-23 22:07:14 +02:00 committed by GitHub
parent 940a3f63ce
commit 491293362f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 71 additions and 8 deletions

View file

@ -1269,7 +1269,7 @@ impl Lock {
/// Returns the package with the given name. If there are multiple
/// matching packages, then an error is returned. If there are no
/// matching packages, then `Ok(None)` is returned.
fn find_by_name(&self, name: &PackageName) -> Result<Option<&Package>, String> {
pub fn find_by_name(&self, name: &PackageName) -> Result<Option<&Package>, String> {
let mut found_dist = None;
for dist in &self.packages {
if &dist.id.name == name {