Skip to content

directory: Refine the way submodules are handled

The git directory loader is used to archive guix source packages where source code is located in a git repository at a specific reference.

To ensure SWH archives the exact same set of source code files for a guix package, the recursive NAR hash of the source code directory is computed and compared against the one computed by guix.

Previously the loader was always fetching git submodules if some were set for the git repository but guix only fetch those for a couple of packages and not for all git based ones. This could result in directory hash mismatch when the loader fetches the submodules while it should have not.

In order to woraround this, first compute the NAR hash without fetching submodules and if this results in a directory hash mismatch then retry the operation with the submodules fetched.

Related to #4751.

Merge request reports