Switch to gix-config because git-config is deprecated (#502)

Co-authored-by: Félix Saparelli <felix@passcod.name>
This commit is contained in:
David Perez 2023-03-01 21:17:19 -06:00 committed by GitHub
parent 46453a2b35
commit 70beb51ab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 108 additions and 139 deletions

239
Cargo.lock generated
View File

@ -287,9 +287,9 @@ dependencies = [
[[package]]
name = "bstr"
version = "1.0.1"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fca0852af221f458706eb0725c03e4ed6c46af9ac98e6a689d5e634215d594dd"
checksum = "5ffdb39cb703212f3c11973452c2861b972f757b021158f3516ba10f2fa8b2c1"
dependencies = [
"memchr",
"once_cell",
@ -767,32 +767,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
[[package]]
name = "git-actor"
version = "0.16.0"
name = "gix-actor"
version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "599cb75eb7c3bf03149b7ab70c66bc0b9a432a092b1154b49d21b49fc7e4bd93"
checksum = "381153ea93b9d8a5c6894a5c734b2e9c15d623063adfd2bda4342ecf90f9a5f8"
dependencies = [
"bstr 1.0.1",
"bstr 1.3.0",
"btoi",
"git-date",
"gix-date",
"itoa",
"nom 7.1.1",
"quick-error",
]
[[package]]
name = "git-config"
version = "0.14.0"
name = "gix-config"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1b95089db62159d7d24c13ddfb4bf949c508521d0bb25331744ef500295ceb8"
checksum = "398b5003d5e4991355528e8fbb4a9d532050c8327df790522735a711db82fcd0"
dependencies = [
"bstr 1.0.1",
"git-config-value",
"git-features",
"git-glob",
"git-path",
"git-ref",
"git-sec",
"bstr 1.3.0",
"gix-config-value",
"gix-features",
"gix-glob",
"gix-path",
"gix-ref",
"gix-sec",
"memchr",
"nom 7.1.1",
"once_cell",
@ -802,85 +802,85 @@ dependencies = [
]
[[package]]
name = "git-config-value"
version = "0.10.0"
name = "gix-config-value"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "989a90c1c630513a153c685b4249b96fdf938afc75bf7ef2ae1ccbd3d799f5db"
checksum = "693d4a4ba0531e46fe558459557a5b29fb86c3e4b2666c1c0861d93c7c678331"
dependencies = [
"bitflags",
"bstr 1.0.1",
"git-path",
"bstr 1.3.0",
"gix-path",
"libc",
"thiserror",
]
[[package]]
name = "git-date"
version = "0.3.1"
name = "gix-date"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a2874ce2f3a77cb144167901ea830969e5c991eac7bfee85e6e3f53ef9fcdf2"
checksum = "b96271912ce39822501616f177dea7218784e6c63be90d5f36322ff3a722aae2"
dependencies = [
"bstr 1.0.1",
"bstr 1.3.0",
"itoa",
"thiserror",
"time",
]
[[package]]
name = "git-features"
version = "0.26.0"
name = "gix-features"
version = "0.26.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ff74064fa007c5beefa89a64bb72834f32b3c497750a56c79c6802bbdb311f9"
checksum = "3402b831ea4bb3af36369d61dbf250eb0e1a8577d3cb77b9719c11a82485bfe9"
dependencies = [
"git-hash",
"gix-hash",
"libc",
"sha1_smol",
"walkdir",
]
[[package]]
name = "git-glob"
version = "0.5.1"
name = "gix-glob"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3908404c9b76ac7b3f636a104142378d3eaa78623cbc6eb7c7f0651979d48e8a"
checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993"
dependencies = [
"bitflags",
"bstr 1.0.1",
"bstr 1.3.0",
]
[[package]]
name = "git-hash"
version = "0.10.1"
name = "gix-hash"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1532d82bf830532f8d545c5b7b568e311e3593f16cf7ee9dd0ce03c74b12b99d"
checksum = "0c0c5a9f4d621d4f4ea046bb331df5c746ca735b8cae5b234cc2be70ee4dbef0"
dependencies = [
"hex",
"thiserror",
]
[[package]]
name = "git-lock"
version = "3.0.0"
name = "gix-lock"
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89e4f05b8a68c3a5dd83a6651c76be384e910fe283072184fdab9d77f87ccec2"
checksum = "e5fe84f09afadec78a7227d80f58cb5412d216dbae4b7fa060b619c0ce62b55d"
dependencies = [
"fastrand",
"git-tempfile",
"gix-tempfile",
"quick-error",
]
[[package]]
name = "git-object"
version = "0.25.0"
name = "gix-object"
version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fad6c2ddb376b99172dc8b651e11be4cb49cef423de4fad563ebbda4fee3fcf6"
checksum = "990d20624b03b216a091e687bb8a27a0b3658b576aa17818264a742c1222bd32"
dependencies = [
"bstr 1.0.1",
"bstr 1.3.0",
"btoi",
"git-actor",
"git-features",
"git-hash",
"git-validate",
"gix-actor",
"gix-features",
"gix-hash",
"gix-validate",
"hex",
"itoa",
"nom 7.1.1",
@ -889,52 +889,52 @@ dependencies = [
]
[[package]]
name = "git-path"
version = "0.7.0"
name = "gix-path"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e40e68481a06da243d3f4dfd86a4be39c24eefb535017a862e845140dcdb878a"
checksum = "f6c104a66dec149cb8f7aaafc6ab797654cf82d67f050fd0cb7e7294e328354b"
dependencies = [
"bstr 1.0.1",
"bstr 1.3.0",
"thiserror",
]
[[package]]
name = "git-ref"
version = "0.22.0"
name = "gix-ref"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b351af399166a5506369e36389d6b9aee744cfa672d0e2ea93d2b01223b1cfbe"
checksum = "93e85abee11aa093f24da7336bf0a8ad598f15da396b28cf1270ab1091137d35"
dependencies = [
"git-actor",
"git-features",
"git-hash",
"git-lock",
"git-object",
"git-path",
"git-tempfile",
"git-validate",
"gix-actor",
"gix-features",
"gix-hash",
"gix-lock",
"gix-object",
"gix-path",
"gix-tempfile",
"gix-validate",
"memmap2",
"nom 7.1.1",
"thiserror",
]
[[package]]
name = "git-sec"
version = "0.6.0"
name = "gix-sec"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1802e8252fa223b0ad89a393aed461132174ced1e6842a41f56dc92a3fc14f"
checksum = "e8ffa5bf0772f9b01de501c035b6b084cf9b8bb07dec41e3afc6a17336a65f47"
dependencies = [
"bitflags",
"dirs 4.0.0",
"git-path",
"gix-path",
"libc",
"windows 0.40.0",
"windows 0.43.0",
]
[[package]]
name = "git-tempfile"
version = "3.0.0"
name = "gix-tempfile"
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6bb4dee86c8cae5a078cfaac3b004ef99c31548ed86218f23a7ff9b4b74f3be"
checksum = "48590cb5de0b8feadee42466a90028877ba67b9fd894c5493b4b64f5e3217c17"
dependencies = [
"dashmap",
"libc",
@ -945,12 +945,12 @@ dependencies = [
]
[[package]]
name = "git-validate"
version = "0.7.1"
name = "gix-validate"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0431cf9352c596dc7c8ec9066ee551ce54e63c86c3c767e5baf763f6019ff3c2"
checksum = "b69ddb780ea1465255e66818d75b7098371c58dbc9560da4488a44b9f5c7e443"
dependencies = [
"bstr 1.0.1",
"bstr 1.3.0",
"thiserror",
]
@ -1134,7 +1134,7 @@ name = "ignore-files"
version = "1.1.0"
dependencies = [
"futures",
"git-config",
"gix-config",
"ignore",
"miette",
"project-origins",
@ -2256,21 +2256,32 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.14"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b"
checksum = "53250a3b3fed8ff8fd988587d8925d26a83ac3845d9e03b220b37f34c2b8d6c2"
dependencies = [
"itoa",
"libc",
"num_threads",
"serde",
"time-core",
"time-macros",
]
[[package]]
name = "time-macros"
version = "0.2.4"
name = "time-core"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792"
checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd"
[[package]]
name = "time-macros"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a460aeb8de6dcb0f381e1ee05f1cd56fcf5a5f6eb8187ff3d8f0b11078d38b7c"
dependencies = [
"time-core",
]
[[package]]
name = "tokio"
@ -2803,17 +2814,17 @@ dependencies = [
[[package]]
name = "windows"
version = "0.40.0"
version = "0.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e30acc718a52fb130fec72b1cb5f55ffeeec9253e1b785e94db222178a6acaa1"
checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244"
dependencies = [
"windows_aarch64_gnullvm 0.40.0",
"windows_aarch64_msvc 0.40.0",
"windows_i686_gnu 0.40.0",
"windows_i686_msvc 0.40.0",
"windows_x86_64_gnu 0.40.0",
"windows_x86_64_gnullvm 0.40.0",
"windows_x86_64_msvc 0.40.0",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc 0.42.0",
"windows_i686_gnu 0.42.0",
"windows_i686_msvc 0.42.0",
"windows_x86_64_gnu 0.42.0",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc 0.42.0",
]
[[package]]
@ -2835,21 +2846,15 @@ version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm 0.42.0",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc 0.42.0",
"windows_i686_gnu 0.42.0",
"windows_i686_msvc 0.42.0",
"windows_x86_64_gnu 0.42.0",
"windows_x86_64_gnullvm 0.42.0",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc 0.42.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3caa4a1a16561b714323ca6b0817403738583033a6a92e04c5d10d4ba37ca10"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.0"
@ -2862,12 +2867,6 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "328973c62dfcc50fb1aaa8e7100676e0b642fe56bac6bafff3327902db843ab4"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.0"
@ -2886,12 +2885,6 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa5b09fad70f0df85dea2ac2a525537e415e2bf63ee31cf9b8e263645ee9f3c1"
[[package]]
name = "windows_i686_gnu"
version = "0.42.0"
@ -2910,12 +2903,6 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a1ad4031c1a98491fa195d8d43d7489cb749f135f2e5c4eed58da094bd0d876"
[[package]]
name = "windows_i686_msvc"
version = "0.42.0"
@ -2934,24 +2921,12 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "520ff37edd72da8064b49d2281182898e17f0688ae9f4070bca27e4b5c162ac7"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "046e5b82215102c44fd75f488f1b9158973d02aa34d06ed85c23d6f5520a2853"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.0"
@ -2970,12 +2945,6 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "windows_x86_64_msvc"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a0c9c6df55dd1bfa76e131cef44bdd8ec9c819ef3611f04dfe453fd5bfeda28"
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.0"

View File

@ -16,7 +16,7 @@ edition = "2021"
[dependencies]
futures = "0.3.21"
git-config = "0.14.0"
gix-config = "0.16.2"
ignore = "0.4.18"
miette = "5.3.0"
thiserror = "1.0.31"

View File

@ -5,7 +5,7 @@ use std::{
path::{Path, PathBuf},
};
use git_config::{path::interpolate::Context as InterpolateContext, File, Path as GitPath};
use gix_config::{path::interpolate::Context as InterpolateContext, File, Path as GitPath};
use project_origins::ProjectType;
use tokio::fs::{canonicalize, metadata, read_dir};
use tracing::{trace, trace_span};
@ -48,7 +48,7 @@ const PATH_SEPARATOR: &str = ";";
///
/// ## Async
///
/// This future is not `Send` due to [`git_config`] internals.
/// This future is not `Send` due to [`gix_config`] internals.
#[allow(clippy::future_not_send)]
pub async fn from_origin(path: impl AsRef<Path> + Send) -> (Vec<IgnoreFile>, Vec<Error>) {
let base = path.as_ref().to_owned();
@ -199,7 +199,7 @@ pub async fn from_origin(path: impl AsRef<Path> + Send) -> (Vec<IgnoreFile>, Vec
///
/// ## Async
///
/// This future is not `Send` due to [`git_config`] internals.
/// This future is not `Send` due to [`gix_config`] internals.
#[allow(clippy::future_not_send)]
pub async fn from_environment(appname: Option<&str>) -> (Vec<IgnoreFile>, Vec<Error>) {
let mut files = Vec::new();