{{ message }}
Fix UnifiedDiffReader to use correct DeltaType#228
Merged
wumpz merged 1 commit intoMay 16, 2026
Merged
Conversation
finalizeChunk() previously always created ChangeDelta regardless of whether the hunk contained only insertions, only deletions, or only context lines. This made it impossible for consumers to determine the actual type of change from the delta alone. Now uses InsertDelta when a hunk contains only additions (no context), DeleteDelta when only deletions (no context), EqualDelta when only context, and ChangeDelta otherwise. Hunks with context lines still use ChangeDelta to preserve backward-compatible applyTo behavior. Fixes java-diff-utils#201
Collaborator
|
Thx for improving and using diff utils. |
Sorry, something went wrong.
Hide details
View details
wumpz
merged commit
61deff7
into
java-diff-utils:master
May 16, 2026
4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
finalizeChunk() previously always created ChangeDelta regardless of whether the hunk contained only insertions, only deletions, or only context lines. This made it impossible for consumers to determine the actual type of change from the delta alone.
Now uses InsertDelta when a hunk contains only additions (no context), DeleteDelta when only deletions (no context), EqualDelta when only context, and ChangeDelta otherwise. Hunks with context lines still use ChangeDelta to preserve backward-compatible applyTo behavior.
Fixes #201.