Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Jun 25, 2018
Merged

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

merged 3 commits into from
Jun 25, 2018

Conversation

catbref
Copy link
Contributor

@catbref catbref commented Feb 28, 2018

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).
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants