Skip to content

housekeeping: Rewrite commit-graphs after pruning objects

This MR iterates on our housekeeping strategy and improves our heuristics to write and re-write commit-graphs. Most importantly, it adjusts OptimizeRepository(), PruneUnreachableObjects() and GarbageCollect() to rewrite commit-graphs when objects have been pruned to fix an issue with commit-graphs referencing commits that don't exist in the object database anymore.

This issue has started to be a lot more visible recently via #2359 (closed) because repository consistency checks have been default-enabled in %15.0. This MR will fix the issue, even though it may take time to fully fix impacted repos: they only become fixed when housekeeping runs in them, and when it decides that we now need to rewrite commit-graphs. In any case it should keep any new instances from popping up.

A second part to fix the issue will be to migrate object pools to use the same housekeeping strategy as normal repositories.

Merge request reports