Skip to content

Extract checksum calculation

James Fargher requested to merge extract_checksum_alg into master

gitlab#35862 (closed)

In order to properly test incremental backup restores we need to start comparing checksums. It doesn't always make sense to create a repository just to call the checksum RPC, such as when you have known refs from a bundle file. So here we're extracting the calculation so it can be used independently of a repository.

This type should be usable for the proposed ephemeral repository table checksums as each ref update can be added individually.

The algorithm no longer uses hex encoding as it was not needed. The big.Int can be set directly from a byte slice without the string interpolation.

The algorithm tries to not to keep the big.Int as a pointer to reduce the chance of escape.

This will likely clash with !3922 (closed) which extracts the whole repository checksum from the RPC.

Edited by James Fargher

Merge request reports