Look for .git before .git/ to work better with submodules.