Skip to content

Commit

Permalink
Omit trivial diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Sep 5, 2024
1 parent 8acbfe3 commit 629d1b0
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 @@ -1043,6 +1043,19 @@ fn show_structured_conflict_diff_hunks(
text = BString::new(print_context(formatter, text.into(), false)?);
}
last_hunk_unmodified_text = Some(Some(text.into()));
} 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 629d1b0

Please sign in to comment.