Skip to content

Commit d8f0948

Browse files
committed
Change local_from_git to skip_checksum
1 parent 1bdfc9d commit d8f0948

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

crates/cargo-test-support/src/registry.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -879,16 +879,8 @@ impl Package {
879879
self
880880
}
881881

882-
/// Call with `true` to publish a git dependency in a "local registry".
883-
///
884-
/// The difference between this and [Package::local] is that this will
885-
/// skip checksum generation as git dependencies do not have checksums.
886-
///
887-
/// See `source-replacement.html#local-registry-sources` for more details
888-
/// on local registries. See `local_registry.rs` for the tests that use
889-
/// this.
890-
pub fn local_from_git(&mut self, local: bool) -> &mut Package {
891-
self.local = local;
882+
/// Call with `true` to prevent a checksum being generated for the package.
883+
pub fn skip_checksum(&mut self, local: bool) -> &mut Package {
892884
self.generate_checksum = !local;
893885
self
894886
}

tests/testsuite/local_registry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ fn git_dependencies_do_not_require_a_checksum() {
563563
t!(fs::create_dir(&root.join(".cargo")));
564564

565565
Package::new("bar", "0.0.1")
566-
.local_from_git(true)
566+
.local(true)
567+
.skip_checksum(true)
567568
.file("src/lib.rs", "pub fn bar() {}")
568569
.publish();
569570

0 commit comments

Comments
 (0)