Skip to content

fix: parsing unified diff chunk headers #198

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

rushiiMachine
Copy link
Contributor

The regex matching chunk headers does not account for unified diffs generated with --show-function-line (with GNU diffutils for example)

Currently this library parses only the following chunk header: @@ -571,6 +571,12 @@
But this is also valid: @@ -571,6 +571,12 @@ .method public constructor <init>(Landro

This also created a very odd error far down the call stack of this method call when old_ln and new_ln are both equal to 0 as a result of failing to parse the chunk headers.

// Process the lines in the last chunk
processLinesInPrevChunk(rawChunk, patch, old_ln, new_ln);

The regex matching chunk headers does not account for diffs generated with --show-function-line
@wumpz wumpz merged commit 8397e20 into java-diff-utils:master Feb 5, 2025
1 check passed
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