Skip to content

Commit 965129a

Browse files
authored
Change local_from_git to skip_checksum
1 parent bfca5c7 commit 965129a

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
@@ -866,16 +866,8 @@ impl Package {
866866
self
867867
}
868868

869-
/// Call with `true` to publish a git dependency in a "local registry".
870-
///
871-
/// The difference between this and [Package::local] is that this will
872-
/// skip checksum generation as git dependencies do not have checksums.
873-
///
874-
/// See `source-replacement.html#local-registry-sources` for more details
875-
/// on local registries. See `local_registry.rs` for the tests that use
876-
/// this.
877-
pub fn local_from_git(&mut self, local: bool) -> &mut Package {
878-
self.local = local;
869+
/// Call with `true` to prevent a checksum being generated for the package.
870+
pub fn skip_checksum(&mut self, local: bool) -> &mut Package {
879871
self.generate_checksum = !local;
880872
self
881873
}

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)