Merge branch 'master' into patch-2

This commit is contained in:
Keith Hall authored and GitHub committed 2026-03-22 17:47:24 +02:00
commit 7a9c6e0de5
3 files changed
+160 -1

No files matched your search

+11 -1
View File
@@ -590,7 +590,17 @@ impl App {
// Plain if `--plain` is specified at least once.
if self.matches.get_count("plain") > 0 {
return Some(StyleComponents(HashSet::from([StyleComponent::Plain])));
let mut components = HashSet::from([StyleComponent::Plain]);
// When --diff is active, preserve change markers and snip separators
// so that diff output remains visually useful.
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);
}
return Some(StyleComponents(components));
}
// Default behavior.