So that users don’t need to implement binary detection themselves.
Export git_buf_text_is_binary and git_buf_text_contains_nul.
Hmm, I feel like if we're going to expose these functions that instead of adding another public header, it would be tempting to just add them as git_buffer_is_binary and git_buffer_contains_nul and either make 1-line wrappers with the new names or just rename the old functions. Of course, @vmg may disagree, but this doesn't feel like significant enough functionality the keep distinct from include/git2/buffer.h.
That's cool too! I was looking at buf_text.h and it seemed like there was other stuff in there that we might want to export in the future. But I'm happy to keep it all in buffer.h if that's what you guys would prefer.
Have you notice the problem in #2436?
Definitely agree with @arrbee let's put this in the buf namespace, at least with a thin wrapper.
Just put it all in buffer.
Moved it to buf.
Hi, does anyone notice the problem in #2436?
And you expose them before git_buf_text_is_binary() is corrected.
Well, to be fair we expose both. Users can decide if they want the simpler NUL check or the heuristic.