]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/index-pack.c
packfile: compute and use the index CRC offset
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 25 May 2020 19:59:10 +0000 (19:59 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 May 2020 17:07:07 +0000 (10:07 -0700)
commit629dffc461f3631bb7acfe905d805caa38b49dfa
tree27250c1f5b7e8ad960ad8f55a84a75a23ced1b72
parent49c9a2ffe59b2e89ed4fd3f90b3dbc5d67760d74
packfile: compute and use the index CRC offset

Both v2 pack index files and the v3 format specified as part of the
NewHash work have similar data starting at the CRC table.  Much of the
existing code wants to read either this table or the offset entries
following it, and in doing so computes the offset each time.

In order to share as much code between v2 and v3, compute the offset of
the CRC table and store it when the pack is opened.  Use this value to
compute offsets to not only the CRC table, but to the offset entries
beyond it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/index-pack.c
object-store.h
packfile.c