Fix .git directory look-up when calling dotGitDirectory on the repo root
Porting bug, includes unit test for patches, which is how I found the problem