From f30b3d3fcb03774a68c42586eaef32bdf4d7f682 Mon Sep 17 00:00:00 2001 From: Preetam Dwivedi Date: Wed, 30 Sep 2026 11:17:57 -0700 Subject: [PATCH] Remove ignored Git binary setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary ### Why? `git.binary` implied that every Git subprocess could use an operator-selected executable, but the implementation consistently invokes `git` from `PATH` and never read the setting. ### What? Remove the unsupported configuration field and example entry, and verify that the obsolete key is rejected instead of silently suggesting custom-binary support. ## Test Plan ✅ `cargo test -p walgit-config removed_git_binary_configuration_is_rejected` ✅ `cargo fmt --all -- --check` ✅ `git diff --check` ## Issue Closes #81 --- crates/walgit-config/src/lib.rs | 10 +++++++--- walgit.example.toml | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/walgit-config/src/lib.rs b/crates/walgit-config/src/lib.rs index 0ae1a152..6c3a2257 100644 --- a/crates/walgit-config/src/lib.rs +++ b/crates/walgit-config/src/lib.rs @@ -565,8 +565,6 @@ pub struct UpstreamConfig { reason = "Independent configuration switches, not mutually exclusive states" )] pub struct GitConfig { - /// Path to the upstream git binary (repack, optional upload-pack engine). - pub binary: PathBuf, pub upload_pack_engine: UploadPackEngine, pub allow_filter: bool, /// Default object format for new repos. @@ -923,7 +921,6 @@ impl Default for LfsConfig { impl Default for GitConfig { fn default() -> Self { GitConfig { - binary: PathBuf::from("git"), upload_pack_engine: UploadPackEngine::Auto, allow_filter: true, object_format: ObjectFormat::Sha1, @@ -1567,6 +1564,13 @@ mod tests { ); } + #[test] + fn removed_git_binary_configuration_is_rejected() { + let input = "[git]\nbinary = \"/opt/git/bin/git\"\n"; + assert!(Config::parse(input).is_err()); + assert!(Config::default().with_settings(input).is_err()); + } + #[test] fn settings_merge_over_config_and_are_restricted() { let mut base = Config::default(); diff --git a/walgit.example.toml b/walgit.example.toml index bfa570c2..e7c7df23 100644 --- a/walgit.example.toml +++ b/walgit.example.toml @@ -179,7 +179,6 @@ max_object_bytes = "16GiB" # maintenance.follow_interval, published through the WAL as a push; fast-forward only [git] -binary = "git" # path to upstream git binary (>= 2.47 recommended: pack.writeReverseIndex) upload_pack_engine = "auto" # "auto" = stock git when packs are local/mount-linked, gix only for remote-served bases | "git" | "gix" allow_filter = true # uploadpack.allowFilter object_format = "sha1" # default for new repos: "sha1" | "sha256"