Checking for a git directory doesn't work because it assumes knowledge of the working directory.