Skip to content

Conversation

@cruessler
Copy link
Contributor

This is a small PR that fixes an oversight in the baseline diff parser in the diff slider tests. The parser now also parses \ No newline at end of file lines. This is something I found while using the script to run more tests. Off the top of my head, I don’t know whether there’s more cases the parser doesn’t handle yet.

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, happy to merge!

Just one suggestion, but I can also merge without it.
And let's try one more thing 😅, feel free to ignore that.

Comment on lines 217 to 224
if line == "\\ No newline at end of file".as_bytes() {
// Do nothing.
} else {
unreachable!(
"BUG: expecting unified diff format, found line: `{}`",
line.to_str_lossy()
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should just be an assert! with message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes a lot of sense, thanks for the suggestion!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the baseline diff parser in the diff slider tests to handle the \ No newline at end of file marker that appears in unified diff format. Additionally, it includes two grammar corrections in comments.

  • Adds handling for \ No newline at end of file lines in the baseline diff parser
  • Improves error messages to show the actual problematic line when an unexpected diff format is encountered
  • Fixes grammar errors in two comment sections

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
gix-diff/tests/diff/blob/slider.rs Adds case for handling backslash-prefixed lines in unified diff format, specifically the "\ No newline at end of file" marker, and improves error messages
tests/it/src/args.rs Corrects grammar by removing duplicate verb "are" from comment
gix-diff/src/blob/platform.rs Fixes subject-verb agreement and double negative in comment ("were...cannot" → "was...can")

@Byron Byron enabled auto-merge December 7, 2025 09:10
@Byron Byron merged commit 33e808c into GitoxideLabs:main Dec 7, 2025
28 checks 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