- Notifications
You must be signed in to change notification settings - Fork2.5k
Ensure that completely ignored diff is empty#5893
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
When a diff has no content -- for example, when there are onlywhitespace changes, and they're being ignored -- we need to avoidprinting the file header. Queue the file header update until the firsthunk is printed, and display it then.
f2b5445
tod704046
CompareIt looks like this broke the tests athttps://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. |
@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. |
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.)