swh-identify: support exclusion patterns (e.g., for .git/) as swh-scanner does
As per title. It is useful to support exclusion patterns for stuff that should commonly be ignored, such as .git/ directories. swh-scanner already has a similar feature (cc: @DanSeraf), which should behave in the same way and, of course, not duplicate code between the two.
Migrated from T2570 (view on Phabricator)