-
Notifications
You must be signed in to change notification settings - Fork 398
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
Fix headers of modified binary files #1629
Conversation
8071288
to
5867c05
Compare
Hey @dandavison, I have reviewed both #945 and #1502 which touched the same code, made slight modifications, and squashed the commits. The main fix was to pre-fill the header fields (minus and plus files etc.) already when at the Another change was a simplification of diff_header_misc.rs, which now correctly adds the I have also updated test_example_diffs.rs to include the handled cases and make the related tests more reliable. One caveat is that the |
5867c05
to
ea45076
Compare
I have now realized the reason for a special treatment of a case with both minus and plus files empty in diff_header_misc.rs. It seems to be parsing of the output of standalone diff, but this was missing tests. I have decided to handle it slightly differently and pass through the Before: After: This is now ready to merge! 🚀 |
@dandavison noticed you started the checks, but I have found an omission for |
ea45076
to
7b8a929
Compare
Done! Here is what was fixed. Calling
There is no reliable way to determine the minus and plus files in such cases, and thus I have decided to align the output here with that of standalone diff as described above: When the |
Excellent! Thanks very much for this work @imbrish. |
All tests pass, but as this is my first time working with Rust and my first contribution here, it would be great if someone more familiar with the codebase could take a closer look 😉
The diff:
Now:
When merged:
Fixes #1621.