-
Notifications
You must be signed in to change notification settings - Fork 6
Handle git diffs that move a file without changing it #21
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds support for parsing git diffs that move/rename a file without changing its content. It builds on PR #19 which added binary file handling, and fixes issue #20.
Changes:
- Added parsing support for git file rename operations with "similarity index 100%"
- Added
binaryfield toPatchstruct to distinguish binary file patches - Enhanced parser to handle git-specific header lines (diff command and index lines)
- Updated Display implementation to format rename-only and binary patches
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/parser.rs | Added diff_command and git_index_line parsers; modified patch() to handle file renames; added test for git file rename |
| src/ast.rs | Added binary field to Patch struct; updated Display to handle binary and rename-only patches |
| tests/regressions.rs | Updated test to include new binary field |
| tests/parse_samples.rs | Improved error messages with debug formatting |
| tests/wild-samples/*.patch | Added test samples for binary files and file renames |
| CHANGELOG.md | Documented fix for issue #20 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f22f1a to
048bc25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
048bc25 to
1de718b
Compare
Stacks after #19
Fixes #20