libgit2/objective-git — pull request #127 by rowanj (2013-01-21 10:49:36+00:00)
Title: When opening a repository let libgit2 find the appropriate git directory

It seems to me that this is something that is likely to be already handled; but I couldn't get my GitX fork to handle submodules initialised under git 1.8 (within the root .git dir) without making this change.

The crux of the issue is that passing the already-converted-to-repository dir to libgit2 meant that it doesn't know which submodule you're actually referring to.

----
This is required when the repository's submodules
have been initialised with git 1.8, and their .git
is nested within the root project's.

If opened directly through the git directory,
libgit2 will lose track of which working directory
a user is trying to manipulate; will be unable to
find refs, and other such fun.