From f973319ce621115fd7d0a118828958f7f40b3306 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 7 Sep 2023 16:44:23 +0200 Subject: [PATCH] adapt to changes in `gix` --- Cargo.lock | 1 + Cargo.toml | 2 +- gitoxide-core/Cargo.toml | 4 ++-- gitoxide-core/src/repository/exclude.rs | 6 +++--- gix-packetline/Cargo.toml | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c8f97b1e89..7fa264f4b6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1959,6 +1959,7 @@ dependencies = [ "futures-lite", "gix-hash 0.12.0", "gix-odb", + "gix-pack", "maybe-async", "pin-project-lite", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3bfc1bda5ee..f997bea91cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ max = ["max-control", "fast", "gitoxide-core-blocking-client", "http-client-curl max-pure = ["max-control", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "http-client-reqwest", "gitoxide-core-blocking-client" ] ## Like `max`, but with more control for configuration. See the *Package Maintainers* headline for more information. -max-control = ["tracing", "fast-safe", "pretty-cli", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-tools", "prodash-render-line", "prodash-render-tui", "prodash/render-line-autoconfigure", "gix/regex" ] +max-control = ["tracing", "fast-safe", "pretty-cli", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-tools", "prodash-render-line", "prodash-render-tui", "prodash/render-line-autoconfigure", "gix/revparse-regex" ] ## All of the good stuff, with less fanciness for smaller binaries. ## diff --git a/gitoxide-core/Cargo.toml b/gitoxide-core/Cargo.toml index 2b1873d704d..ff8a58b3acf 100644 --- a/gitoxide-core/Cargo.toml +++ b/gitoxide-core/Cargo.toml @@ -44,8 +44,8 @@ serde = ["gix/serde", "dep:serde_json", "dep:serde", "bytesize/serde"] [dependencies] # deselect everything else (like "performance") as this should be controllable by the parent application. -gix = { version = "^0.53.0", path = "../gix", default-features = false } -gix-pack-for-configuration-only = { package = "gix-pack", version = "^0.41.0", path = "../gix-pack", default-features = false, features = ["pack-cache-lru-dynamic", "pack-cache-lru-static"] } +gix = { version = "^0.53.0", path = "../gix", default-features = false, features = ["blob-diff", "revision", "mailmap", "excludes", "attributes", "worktree-mutation", "credentials"] } +gix-pack-for-configuration-only = { package = "gix-pack", version = "^0.41.0", path = "../gix-pack", default-features = false, features = ["pack-cache-lru-dynamic", "pack-cache-lru-static", "generate", "streaming-input"] } gix-transport-configuration-only = { package = "gix-transport", version = "^0.35.0", path = "../gix-transport", default-features = false } gix-archive-for-configuration-only = { package = "gix-archive", version = "^0.3.0", path = "../gix-archive", optional = true, features = ["tar", "tar_gz"] } serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] } diff --git a/gitoxide-core/src/repository/exclude.rs b/gitoxide-core/src/repository/exclude.rs index f3ed2e3595a..b73af2a8767 100644 --- a/gitoxide-core/src/repository/exclude.rs +++ b/gitoxide-core/src/repository/exclude.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::io; use anyhow::{anyhow, bail}; -use gix::{bstr::BStr, prelude::FindExt}; +use gix::bstr::BStr; use crate::{repository::PathsOrPatterns, OutputFormat}; @@ -49,7 +49,7 @@ pub fn query( .metadata() .ok() .map(|m| m.is_dir()); - let entry = cache.at_entry(path.as_slice(), is_dir, |oid, buf| repo.objects.find_blob(oid, buf))?; + let entry = cache.at_entry(path.as_slice(), is_dir)?; let match_ = entry .matching_exclude_pattern() .and_then(|m| (show_ignore_patterns || !m.pattern.is_negative()).then_some(m)); @@ -68,7 +68,7 @@ pub fn query( .index_entries_with_paths(&index) .ok_or_else(|| anyhow!("Pathspec didn't yield any entry"))? { - let entry = cache.at_entry(path, Some(false), |oid, buf| repo.objects.find_blob(oid, buf))?; + let entry = cache.at_entry(path, Some(false))?; let match_ = entry .matching_exclude_pattern() .and_then(|m| (show_ignore_patterns || !m.pattern.is_negative()).then_some(m)); diff --git a/gix-packetline/Cargo.toml b/gix-packetline/Cargo.toml index 863f4ee4c9b..0cd8753d1e1 100644 --- a/gix-packetline/Cargo.toml +++ b/gix-packetline/Cargo.toml @@ -52,6 +52,7 @@ document-features = { version = "0.2.0", optional = true } [dev-dependencies] gix-odb = { path = "../gix-odb" } +gix-pack-for-configuration = { package = "gix-pack", path = "../gix-pack", default-features = false, features = ["streaming-input"] } gix-hash = { path = "../gix-hash" } async-std = { version = "1.9.0", features = ["attributes"] } maybe-async = "0.2.6"