loader: Ensure to fetch latest snapshot produced by a git visit type
SWH data model allows an origin to have multiple visit types, in particular a git origin can have visit types 'git' and 'git-checkout'.
We must ensure to retrieve the latest snapshot for a git visit type in the git loader implementation as it can break incremental loading of a git origin having both visit types mentioned above.
Indeed a 'git-checkout' visit type produces a snapshot with a single branch while a 'git' visit type produces a snapshot containing all branches of the loaded repository. Previously, if the latest snapshot retrieved was produced by a 'git-checkout' visit type, the loader would refetch all branches and associated git objects while most of them have already been archived.
Related to swh/meta#5092.
CI will fail until a new swh-storage
tag is pushed.