Skip to content

Commit

Permalink
fix(add): Don't select yanked versions when normalizing names
Browse files Browse the repository at this point in the history
Fixes #14893
  • Loading branch information
epage committed Dec 5, 2024
1 parent 7c7a7bb commit 6b56ffb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/cargo/sources/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,13 @@ impl<'gctx> Source for RegistrySource<'gctx> {
}
any_pending |= self
.index
.query_inner(name_permutation, &req, &mut *self.ops, f)?
.query_inner(name_permutation, &req, &mut *self.ops, &mut |s| {
if !s.is_yanked() {
f(s);
} else if kind == QueryKind::Alternatives {
f(s);
}
})?
.is_pending();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn case() {
.arg_line("linked_hash_map")
.current_dir(cwd)
.assert()
.failure()
.success()
.stdout_eq(str![""])
.stderr_eq(file!["stderr.term.svg"]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
name = "cargo-list-test-fixture"
version = "0.0.0"
edition = "2015"

[dependencies]
linked-hash-map = "0.5.4"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b56ffb

Please sign in to comment.