From 9aec9abcd6b78bba27e8ea6000f6e4592bcc9397 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 25 Sep 2023 18:40:40 +0200 Subject: [PATCH 1/4] feat: upgrade `gix` to v0.54 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 21a5c2a4..27f774a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ name = "update_and_get_latest" required-features = ["git-https"] [dependencies] -gix = { version = "0.51.0", default-features = false, features = ["max-performance-safe", "blocking-network-client"], optional = true } +gix = { version = "0.54.1", default-features = false, features = ["max-performance-safe", "blocking-network-client"], optional = true } hex = { version = "0.4.3", features = ["serde"] } home = "0.5.4" http = { version = "0.2", optional = true } From 1f739940b00be746dcd06edc8b00b586817845eb Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 25 Sep 2023 18:43:27 +0200 Subject: [PATCH 2/4] adjust test expectations --- tests/mem.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mem.rs b/tests/mem.rs index 28857109..8c63e9c4 100644 --- a/tests/mem.rs +++ b/tests/mem.rs @@ -34,7 +34,7 @@ mod mem { peak = ByteSize(ALLOCATOR.max_allocated() as u64), ); assert!( - per_crate < 6300, + per_crate < 6600, "per crate limit {per_crate}B should remain below memory limit" ); } From fc79c6711946c83f8a7fd6e892dd446de3345622 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 25 Sep 2023 18:51:51 +0200 Subject: [PATCH 3/4] upgrade `toml` to latest version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 27f774a0..0e9cb818 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ serde_derive = "1.0.160" serde_json = "1.0.96" smol_str = { version = "0.2.0", features = ["serde"] } thiserror = "1.0.43" -toml = "0.7.3" +toml = "0.8.0" document-features = { version = "0.2.0", optional = true } From 61b93a1e9b21ac3a8c146570e6fdebdaaffdd698 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 25 Sep 2023 19:06:59 +0200 Subject: [PATCH 4/4] fix: be less strict when determining if the crates-index remote matches the target URL. Previously a trailing slash could have caused it to think ti's not the same. --- src/git/impl_.rs | 3 ++- tests/git/mod.rs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/git/impl_.rs b/src/git/impl_.rs index 1239f956..4a9dd6fd 100644 --- a/src/git/impl_.rs +++ b/src/git/impl_.rs @@ -3,6 +3,7 @@ use crate::dirs::{crate_name_to_relative_path, local_path_and_canonical_url}; use crate::error::GixError; use crate::git::{changes, config, URL}; use crate::{path_max_byte_len, Crate, Error, GitIndex, IndexConfig}; +use gix::bstr::ByteSlice; use gix::config::tree::Key; use std::io; use std::path::{Path, PathBuf}; @@ -174,7 +175,7 @@ impl GitIndex { repo.find_remote("origin").map_or(true, |remote| { remote .url(gix::remote::Direction::Fetch) - .map_or(false, |remote_url| remote_url.to_bstring() == url) + .map_or(false, |remote_url| remote_url.to_bstring().starts_with_str(&url)) }) }); diff --git a/tests/git/mod.rs b/tests/git/mod.rs index e959a2d7..53f98180 100644 --- a/tests/git/mod.rs +++ b/tests/git/mod.rs @@ -190,7 +190,12 @@ pub(crate) mod with_https { let index_path = "tests/fixtures/git-registry"; if is_ci::cached() { - GitIndex::new_cargo_default().expect("CI has just cloned this index and its ours and valid") + let index = GitIndex::new_cargo_default().expect("CI has just cloned this index and its ours and valid"); + assert!( + GitIndex::try_new_cargo_default().unwrap().is_some(), + "index should exist if we just retrieved it" + ); + index } else { GitIndex::with_path(index_path, URL).expect("clone works and there is no racing") }