1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-23 17:03:18 +00:00

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 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-03-20 15:27:10 -07:00
parent 169dc7c45b
commit e60875ac12
+1
View File
@@ -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);
}