Don't scan ignored folders using `.gitignore` safelist setup (#20397)