Skip to content

Commit f92379d

Browse files
committed
Stabilize sparse-registry for crates.io
1 parent 3516206 commit f92379d

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/cargo/sources/registry/http_remote.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl<'cfg> HttpRegistry<'cfg> {
131131
config: &'cfg Config,
132132
name: &str,
133133
) -> CargoResult<HttpRegistry<'cfg>> {
134-
if !config.cli_unstable().sparse_registry {
134+
if !source_id.is_crates_io() && !config.cli_unstable().sparse_registry {
135135
anyhow::bail!("usage of sparse registries requires `-Z sparse-registry`");
136136
}
137137
let url = source_id.url().as_str();

tests/testsuite/registry.rs

-9
Original file line numberDiff line numberDiff line change
@@ -2703,15 +2703,6 @@ fn http_requires_z_flag() {
27032703
.run();
27042704
}
27052705

2706-
#[cargo_test]
2707-
fn protocol_sparse_requires_z_flag() {
2708-
cargo_process("install bar")
2709-
.with_status(101)
2710-
.env("CARGO_REGISTRIES_CRATES_IO_PROTOCOL", "sparse")
2711-
.with_stderr("[ERROR] usage of sparse registries requires `-Z sparse-registry`")
2712-
.run()
2713-
}
2714-
27152706
#[cargo_test]
27162707
fn protocol() {
27172708
cargo_process("install bar")

0 commit comments

Comments
 (0)