Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

carlosmn
Copy link
Member

@carlosmn carlosmn commented Sep 24, 2024

In diff_print_patch_file we try to avoid printing the file if we're not sure
that there will be some content. This works fine if we have any later functions
that might get called as part of printing. But when given the format
GIT_DIFF_FORMAT_PATCH_HEADER, this is the only function to get called.

Force us to print the diff header for the file in such a situation. This may
still print the header where e.g. GIT_DIFF_FORMAT_PATCH wouldn't, but it's
better than this option not working at all.

This fixes a regression introduced in #5893 that's making the rugged tests fail to pass. This sort of regresses that fix by sending out the header more than we'd like, but this is a fix I could make quickly.

An alternative might be to still call the hunk function but have it return early if the format is just asking for the header (that might require teaching a few of these functions though as we could still instead land in the binary function).

This was a regression leading up to 1.8.
In `diff_print_patch_file` we try to avoid printing the file if we're not sure
that there will be some content. This works fine if we have any later functions
that might get called as part of printing. But when given the format
`GIT_DIFF_FORMAT_PATCH_HEADER`, this is the only function to get called.

Force us to print the diff header for the file in such a situation. This may
still print the header where e.g. `GIT_DIFF_FORMAT_PATCH` wouldn't, but it's
better than this option not working at all.
@ethomson
Copy link
Member

Closed in favor of #6888

@ethomson ethomson closed this Sep 25, 2024
@carlosmn carlosmn deleted the cmn/always-print-header-on-request branch September 25, 2024 07:39
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