- Description:
- The Software Heritage Git Loader: www.softwareheritage.org
- Last Change:
- Clone URL:
ssh://anonymous@git.chirpysoft.be/swh-loader-git.git
Commit Briefs
tests: Fix numerous tests after recent changes in loader-core (master)
BaseLoader.load now returns a dict with an extra error field when a loading fails.
tests: Fix mocking of sleep calls with tenacity 8.4.2
Latest tenacity release adds some internal changes that broke the mocking of sleep calls in tests. Fix it by directly mocking time.sleep (was not working previously).
Replace usage of (deprecated) dir_filter by path_filter in Directory.from_disk()
as well as in GitCheckoutLoader.
test_loader: Fix implementation of test_loader_with_ref_delta_in_pack
Previous implementation was building an invalid pack file with REF_DELTA object types as it was using the new object to deltify as the base of the delta. This was leading to errors and undefined behavior after building an index for such a pack file as the deltified objects could not be properly resolved by dulwich (observed by stsp while working on git loader improvements). The bases for deltified objects are now objects that were previously loaded into the archive. Tag objects produced in that test are also ensured to be valid.
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.
requirements-test: Add missing swh.loader.core[testing] dependency
Side effect of swh.loader.core v5.18.0 release.