From f7f24e537246a47498d41f06816c14f17ea4ee48 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 11 Sep 2024 00:01:31 -0400 Subject: [PATCH] change: In gix-testtools use `ignore` and `index` via `gix_worktree` This removes the `gix-ignore` and `gix-index` direct dependencies of `gix-testtools`, by having `gix_testtools` use them through `gix-worktree`, accessing `gix_worktree::ignore` for `gix_ignore` and `gix_worktree::index` for `gix_index`. The rationale is that various other gix-* dependencies were used this way already, and also that this specific change appears to have been planned, based on the TODO comment in ddaacda (#1413). --- Cargo.lock | 2 -- tests/tools/Cargo.toml | 3 --- tests/tools/src/lib.rs | 6 +++--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d923e259f57..ad92273b749 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2577,8 +2577,6 @@ dependencies = [ "fs_extra", "gix-discover 0.32.0", "gix-fs 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "gix-ignore 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", - "gix-index 0.33.1", "gix-lock 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gix-tempfile 14.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "gix-worktree 0.34.1", diff --git a/tests/tools/Cargo.toml b/tests/tools/Cargo.toml index 107c85c579a..b4201fb3942 100644 --- a/tests/tools/Cargo.toml +++ b/tests/tools/Cargo.toml @@ -27,9 +27,6 @@ xz = ["dep:xz2"] [dependencies] gix-lock = "14.0.0" gix-discover = "0.32.0" -# TODO(ST) remove once `gix-worktree` exports `index`. -gix-ignore = "0.11.2" -gix-index = "0.33.0" gix-worktree = "0.34.0" gix-fs = "0.11" gix-tempfile = { version = "^14.0.0", default-features = false, features = ["signals"] } diff --git a/tests/tools/src/lib.rs b/tests/tools/src/lib.rs index 513c06c91bf..ad3b0e964af 100644 --- a/tests/tools/src/lib.rs +++ b/tests/tools/src/lib.rs @@ -67,11 +67,11 @@ static EXCLUDE_LUT: Lazy>> = Lazy::new(|| { let mut buf = Vec::with_capacity(512); let case = gix_fs::Capabilities::probe(&work_tree) .ignore_case - .then_some(gix_ignore::glob::pattern::Case::Fold) + .then_some(gix_worktree::ignore::glob::pattern::Case::Fold) .unwrap_or_default(); let state = gix_worktree::stack::State::IgnoreStack(gix_worktree::stack::state::Ignore::new( Default::default(), - gix_ignore::Search::from_git_dir(&gix_dir, None, &mut buf).ok()?, + gix_worktree::ignore::Search::from_git_dir(&gix_dir, None, &mut buf).ok()?, None, gix_worktree::stack::state::ignore::Source::WorktreeThenIdMappingIfNotSkipped, )); @@ -707,7 +707,7 @@ fn is_excluded(archive: &Path) -> bool { cache .at_path( relative_path, - Some(gix_index::entry::Mode::FILE), + Some(gix_worktree::index::entry::Mode::FILE), &gix_worktree::object::find::Never, ) .ok()?