libgit2/libgit2 — pull request #886 by carlosmn (2012-08-20 09:25:25+00:00)
Title: tree builder: add convenience functions for inserting a blob or a tree

Passing the attributes for a blob or tree manually can be
error-prone. Add convencience functions so we can add blobs and trees
without needing to know what attributes git needs for them.

---

Since git's attributes are just for file, executable file, dir, symlink and submodule, it seems to me that we can make that clearer from the function names what we're trying to do (from the user's perspective, reading the code weeks down the line), which also reduces the chances of getting the attributes wrong. They're not that hard to get right, but who actually gets octal right the first time around?