From e60875ac125f6698775679fa9a8beb495299b4e5 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:27:10 -0700 Subject: [PATCH] fix: gate Changes component on git feature flag When bat is built without the `git` feature, `StyleComponent::Changes` is not available. Add `#[cfg(feature = "git")]` guard so `--diff --plain` works in both configurations. Co-Authored-By: Claude Opus 4.6 --- src/bin/bat/app.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index a580ff02..f95bbb91 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -596,6 +596,7 @@ impl App { if self.matches.try_contains_id("diff").unwrap_or_default() && self.matches.get_flag("diff") { + #[cfg(feature = "git")] components.insert(StyleComponent::Changes); components.insert(StyleComponent::Snip); }