Fix check for .git dir