check if current directory is the root of a git repository (in various functions)