Skip to content

Fix for issue #20 correcting empty-context add-only patches - #37

Merged
dnaumenko merged 3 commits into
dnaumenko:masterfrom
catbref:master
Jun 25, 2018
Merged

dnaumenko merged 3 commits into
dnaumenko:masterfrom
catbref:master

Conversation

@catbref

@catbref catbref commented Feb 28, 2018

Copy link
Copy Markdown
Contributor

Empty-context add-only patches were applied in the wrong place,
typically one line early.

This commit uses the code submitted in the issue but tidied up
and corrected for current master snapshot.

Empty-context add-only patches were applied in the wrong place,
typically one line early.

This commit uses the code submitted in the issue but tidied up
and corrected for current master snapshot.
Bad copy&paste caused use of InsertDelta instead of DeleteDelta
when applying fix for issue #20.

Also improved test to cover empty-context patches that delete lines
to cover this case.
DiffUtils.generateUnifiedDiff() produced off-by-one positions for
hunks with empty context/content.

EmptyContextUnifiedDiffTest.java has been improved to test for this.
(Some test resource files renamed in light of more general use).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants