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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user