Skip to content

Commit

Permalink
Omit trivial diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Aug 13, 2024
1 parent 73b853a commit 6f1379a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cli/src/diff_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,19 @@ fn show_structured_conflict_diff_hunks(
text = print_context(formatter, text, false)?;
}
last_hunk_unmodified_text = Some(Some(text));
} else if explained_hunk.iter().all(|elt| {
matches!(
elt,
DiffExplanationAtom::UnchangedConflictAdd(_)
| DiffExplanationAtom::UnchangedConflictRemove(_)
)
}) {
// The conflict wasn't modified.
// TODO: Is there a better way to present the unmodified conflict in the
// context?
last_hunk_unmodified_text = Some(Some(
b"<<<<<<< Unmodified conflict (omitted) >>>>>>>".to_vec(),
));
} else if let [DiffExplanationAtom::ChangedConflictAdd {
left_version,
right_version,
Expand Down

0 comments on commit 6f1379a

Please sign in to comment.