Checking if the current directory is a git repo first is a bit faster.