libgit2/libgit2 — pull request #852 by arrbee (2012-08-02 20:47:28+00:00)
Title: Submodule extensions

This is a rewrite of the libgit2 submodule support. It features:

* Opaque `git_submodule` object instead of a public struct
* Support for reading submodule information from working directory, index, .gitmodules file, and HEAD tree
* API versions of git submodule add, init, sync, and status
* API to add the submodule to the index using the current HEAD oid

To support `git submodule add`, which would typically require a network fetch and checkout, this API splits the command into two calls: `git_submodule_add_setup` which does everything to add the new submodule up to actually performing the fetch and checkout, and `git_submodule_add_finalize` which completes the `add` operation after the fetch and checkout are done. In practice, this will put the API user in control of the slow parts of the operation while still making it pretty easy to emulate `git_submodule_add`.

There is a bunch of new test data along with some test helpers to make it easier to write submodule tests.

This PR depends on (and contains the commits for) the new `git_repository_init_ext` API (PR #844) and also contains PR #843 although that second one could be backed out if necessary, I think.