/**
look for the .git repo in "../test/repo/a/".
The .git directory will be found one dir up, and will
contain the line 'gitdir: ../../.git/modules/test/repo'.
The function will expand this line and return the true
repository location.
*/
string path = buildPath(_testRepo.dirName, "a");
string repoPath = discoverRepo(path);
assert(repoPath.relativePath.toPosixPath == "../.git/modules/test/repo");
// verify the repo can be opened
auto repo = GitRepo(repoPath);
// ceiling dir is found before any git repository
string path = buildPath(_testRepo.dirName, "a");
string[] ceils = [_testRepo.dirName.absolutePath.buildNormalizedPath];
assertThrown!GitException(discoverRepo(path, ceils));
// all ceiling paths must be absolute
string[] ceils = ["../.."];
assertThrown!AssertError(discoverRepo(_testRepo.dirName, ceils));
Discover a git repository and return its path if found.
The lookup starts from startPath and continues searching across parent directories. The lookup stops when one of the following becomes true: