Skip to content

Commit

Permalink
Change local_from_git to skip_checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
jarhodes314 authored Oct 7, 2022
1 parent bfca5c7 commit 965129a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 2 additions & 10 deletions crates/cargo-test-support/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,16 +866,8 @@ impl Package {
self
}

/// Call with `true` to publish a git dependency in a "local registry".
///
/// The difference between this and [Package::local] is that this will
/// skip checksum generation as git dependencies do not have checksums.
///
/// See `source-replacement.html#local-registry-sources` for more details
/// on local registries. See `local_registry.rs` for the tests that use
/// this.
pub fn local_from_git(&mut self, local: bool) -> &mut Package {
self.local = local;
/// Call with `true` to prevent a checksum being generated for the package.
pub fn skip_checksum(&mut self, local: bool) -> &mut Package {
self.generate_checksum = !local;
self
}
Expand Down
3 changes: 2 additions & 1 deletion tests/testsuite/local_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ fn git_dependencies_do_not_require_a_checksum() {
t!(fs::create_dir(&root.join(".cargo")));

Package::new("bar", "0.0.1")
.local_from_git(true)
.local(true)
.skip_checksum(true)
.file("src/lib.rs", "pub fn bar() {}")
.publish();

Expand Down

0 comments on commit 965129a

Please sign in to comment.