libgit2/libgit2 — pull request #1088 by arrbee (2012-11-19 18:33:27+00:00)
Title: Consolidate text buffer functions

There are many scattered functions that look into the contents of buffers to do various text manipulations (such as escaping or unescaping data, calculating text stats, guessing if content is binary, etc). This groups all those functions together into a new file (`src/buf_text.c`) and converts the code to use that.

Apart from rearranging things, this PR has two enhancements to existing functionality. The old text stats function is significantly rewritten and the BOM detection code was extended (although largely we can't deal with anything other than a UTF8 BOM).

I'll be curious what folks think about this. I'm somewhat happy with the naming since all the consolidated functions end up prefixed with `git_buf_text_...` which makes it clear that they are still `git_buf` functions but they are now separated from `buffer.[ch]` so that file isn't just full of less used utilities.