Skip to content

Commit

Permalink
Stabilize sparse-registry for crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
arlosi committed Oct 12, 2022
1 parent 3516206 commit f92379d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/cargo/sources/registry/http_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl<'cfg> HttpRegistry<'cfg> {
config: &'cfg Config,
name: &str,
) -> CargoResult<HttpRegistry<'cfg>> {
if !config.cli_unstable().sparse_registry {
if !source_id.is_crates_io() && !config.cli_unstable().sparse_registry {
anyhow::bail!("usage of sparse registries requires `-Z sparse-registry`");
}
let url = source_id.url().as_str();
Expand Down
9 changes: 0 additions & 9 deletions tests/testsuite/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2703,15 +2703,6 @@ fn http_requires_z_flag() {
.run();
}

#[cargo_test]
fn protocol_sparse_requires_z_flag() {
cargo_process("install bar")
.with_status(101)
.env("CARGO_REGISTRIES_CRATES_IO_PROTOCOL", "sparse")
.with_stderr("[ERROR] usage of sparse registries requires `-Z sparse-registry`")
.run()
}

#[cargo_test]
fn protocol() {
cargo_process("install bar")
Expand Down

0 comments on commit f92379d

Please sign in to comment.