test for .git dir with -d not -e; more portable