Skip to content

housekeeping: Rewrite commit-graphs when expiring cruft

Since 83802e11 (housekeeping: Fix commit-graphs referencing pruned commits, 2022-07-08), we have started rewriting commit-graphs when pruning objects from a repository. This is required so that the commit graph won't continue to reference objects that may be deleted as part of the pruning step.

With the recent introduction of cruft packs in e4a9ded8 (housekeeping: Wire up logic to conditionally generate cruft packs, 2023-03-03) we have added a second way to prune objects, which is via git-repack(1) when writing cruft packs with an expiry date. We didn't update the logic to determine whether to rewrite the commit-graph chain though, which means that we can again run into the issue that the graph references objects that don't exist anymore.

Fix the bug by also rewriting commit-graphs when repacking objects with cruft packs and an expiry date.

Changelog: fixed

Merge request reports