Skip to content

Commit 3c3901f

Browse files
authored
Merge branch 'rust-lang:master' into fix-metadata-not-retriggering-builds
2 parents d999267 + 0c157e0 commit 3c3901f

File tree

5 files changed

+76
-50
lines changed

5 files changed

+76
-50
lines changed

Cargo.lock

Lines changed: 61 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ filetime = "0.2.23"
4949
flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
5050
git2 = "0.19.0"
5151
git2-curl = "0.20.0"
52-
gix = { version = "0.68.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
52+
gix = { version = "0.69.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
5353
glob = "0.3.1"
5454
handlebars = { version = "6.0.0", features = ["dir_source"] }
5555
hex = "0.4.3"

src/cargo/core/source_id.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,10 @@ impl SourceId {
532532
url == CRATES_IO_INDEX || url == CRATES_IO_HTTP_INDEX || is_overridden_crates_io_url(url)
533533
}
534534

535-
/// Hashes `self`.
535+
/// Hashes `self` to be used in the name of some Cargo folders, so shouldn't vary.
536+
///
537+
/// For git and url, `as_str` gives the serialisation of a url (which has a spec) and so
538+
/// insulates against possible changes in how the url crate does hashing.
536539
///
537540
/// For paths, remove the workspace prefix so the same source will give the
538541
/// same hash in different locations, helping reproducible builds.
@@ -550,7 +553,11 @@ impl SourceId {
550553
return;
551554
}
552555
}
553-
self.hash(into)
556+
self.inner.kind.hash(into);
557+
match self.inner.kind {
558+
SourceKind::Git(_) => (&self).inner.canonical_url.hash(into),
559+
_ => (&self).inner.url.as_str().hash(into),
560+
}
554561
}
555562

556563
pub fn full_eq(self, other: SourceId) -> bool {
@@ -665,16 +672,10 @@ impl fmt::Display for SourceId {
665672
}
666673
}
667674

668-
/// The hash of `SourceId` is used in the name of some Cargo folders, so shouldn't
669-
/// vary. `as_str` gives the serialisation of a url (which has a spec) and so
670-
/// insulates against possible changes in how the url crate does hashing.
671675
impl Hash for SourceId {
672676
fn hash<S: hash::Hasher>(&self, into: &mut S) {
673677
self.inner.kind.hash(into);
674-
match self.inner.kind {
675-
SourceKind::Git(_) => self.inner.canonical_url.hash(into),
676-
_ => self.inner.url.as_str().hash(into),
677-
}
678+
self.inner.canonical_url.hash(into);
678679
}
679680
}
680681

src/cargo/sources/git/oxide.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ pub fn cargo_config_to_gitoxide_overrides(gctx: &GlobalContext) -> CargoResult<V
352352
}
353353

354354
/// Reinitializes a given Git repository. This is useful when a Git repository
355-
/// seems corrupted and we want to start over.
355+
/// seems corrupted, and we want to start over.
356356
pub fn reinitialize(git_dir: &Path) -> CargoResult<()> {
357357
fn init(path: &Path, bare: bool) -> CargoResult<()> {
358358
let mut opts = git2::RepositoryInitOptions::new();

src/cargo/sources/git/utils.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,9 @@ pub fn fetch(
10571057
fn has_shallow_lock_file(err: &crate::sources::git::fetch::Error) -> bool {
10581058
matches!(
10591059
err,
1060-
gix::env::collate::fetch::Error::Fetch(gix::remote::fetch::Error::LockShallowFile(_))
1060+
gix::env::collate::fetch::Error::Fetch(gix::remote::fetch::Error::Fetch(
1061+
gix::protocol::fetch::Error::LockShallowFile(_)
1062+
))
10611063
)
10621064
}
10631065

0 commit comments

Comments
 (0)