Conversation
Test case for issue where interdiff incorrectly reports 'patch2 is empty' when the @@ line isn't immediately after the +++ line (e.g., when there's an 'index' line in between). This test currently fails on 0.4.x and will pass after applying the fix from commit 3a6e39d. Assisted-by: Claude Code
When an @@ line isn't immediately after the +++ line in patch2, the next line is checked from the top of the loop which tries to search for a +++ line again, even though the +++ was already found. This results in the +++ not being found again and thus a spurious error that patch2 is empty. Fix this by making the patch2 case loop over the next line until either an @@ is found or the patch is exhausted.
Test case for issue where interdiff incorrectly warns that patches don't contain a patch when they only have mode changes, binary diffs, or merge metadata without actual unified diff content. This test currently fails on 0.4.x and will pass after applying the fix from commit edded43. Assisted-by: Claude Code
Patches that contain only mode changes, binary diffs, merge metadata, or no diff content at all would trigger a spurious error message. Check for actual file-header '--- a/' or '--- /dev/null' lines before reporting a patch as invalid. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Coloring the newline character results in the terminal cursor becoming colored when the final line in the interdiff is colored. Fix this by not coloring the newline character.
When a '---' header is parsed but the following line is not '+++' or hits EOF, the allocated filename from the '---' line is leaked. Free it on both early-exit paths, matching the pattern already used in index_patch_generic(). Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
408fed4 to
87e0099
Compare
Add the two new test cases to the TESTS variable: - tests/interdiff-patch2-headers/run-test - tests/interdiff-mode-only/run-test Assisted-by: Claude Code
87e0099 to
548613e
Compare
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
Add this suggestion to a batch that can be applied as a single commit.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.Add this suggestion to a batch that can be applied as a single commit.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.Suggestion cannot be applied right now. Please check back later.
Add in some bug fixes from #156 along with test cases.