libgit2/libgit2 — pull request #499 by arrbee (2011-11-28 06:37:04+00:00)
Title: Extend git_buf with new utility functions and unit tests.

Add new functions to `git_buf` for:
* initializing a buffer from a string
* joining one or more strings onto a buffer with separators
* swapping two buffers in place
* extracting data from a git_buf (leaving it empty)

Also, this:
* makes `git_buf_free` leave a `git_buf` back in its freshly initialized state
* slightly tweaks buffer allocation sizes and thresholds
* ports the buffer unit tests to clay and extends them

These changes should have no significant impact on the library (although my not-super-careful testing indicates that the buffer allocation tweaks notably reduces the number of reallocs that end up being done by the test suite). The real goal of this is to lay the groundwork for reworking the dynamic `git_path` patch to use `git_buf` instead, so we just have one type of dynamically allocated managed buffer in the code.