Fix detection of being in a git controlled directory