Only check permissions if .git dir exists