Skip to content

Conversation

ethomson
Copy link
Member

When all contents of a diff are ignored, the resulting buffer should be empty but is instead malformed (includes a header but no hunks).

(This adds a failing test only at this point.)

When a diff has no content -- for example, when there are only
whitespace changes, and they're being ignored -- we need to avoid
printing the file header. Queue the file header update until the first
hunk is printed, and display it then.
@carlosmn
Copy link
Member

carlosmn commented Apr 3, 2024

It looks like this broke the tests at https://github.com/libgit2/rugged/blob/57257cbb7ea4b40debf5ec244e27ebffeaf40b16/test/diff_test.rb#L921 where we're just asking for the patch header. It looks like waiting to generate the patch header until we try to generate the content doesn't work if we never even wanted to generate any of the content but do want the header.

@ethomson
Copy link
Member Author

@carlosmn bleh. I suppose that instead of delaying sending the header until we send the first piece of content, we need to go find the first piece of content, and if there is some, enqueue it and deliver the header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants