Simplify .git directory check