[go: up one dir, main page]

Skip to content

Support ignoring fsck check in 'index-pack --fsck-objects'

In gitaly#5779, we'd like to fsck the object that are about to be committed in a transaction's packfile. Git index-pack provides two flags to fsck the objects:

  • git index-pack --fsck-objects just fsck the objects.
  • git index-pack --strict checks connectivity and fsck the objects. It also supports disabling some of the fsck checks

--strict performs too much work for our use case as we've already walked the graph and checked the connectivity of the objects when we packed them.

--fsck-objects would just perform the needed part but doesn't support configuring the checks. This is a problem as Gitaly disables some checks.

Let's extend --fsck-objects to support also disabling some of the fsck checks. That way we can feed it the disabled checks and use the flag to just fsck the new objects.

With this, we can just check the new objects. This should lead to a significant performance increase when checking data received over pushes and fetches.