Better support for finding git directory