summaryrefslogtreecommitdiff
path: root/object-store.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-05-25 19:59:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-27 17:07:07 (GMT)
commit629dffc461f3631bb7acfe905d805caa38b49dfa (patch)
tree27250c1f5b7e8ad960ad8f55a84a75a23ced1b72 /object-store.h
parent49c9a2ffe59b2e89ed4fd3f90b3dbc5d67760d74 (diff)
downloadgit-629dffc461f3631bb7acfe905d805caa38b49dfa.zip
git-629dffc461f3631bb7acfe905d805caa38b49dfa.tar.gz
git-629dffc461f3631bb7acfe905d805caa38b49dfa.tar.bz2
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>
Diffstat (limited to 'object-store.h')
-rw-r--r--object-store.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/object-store.h b/object-store.h
index d1e490f..f439d47 100644
--- a/object-store.h
+++ b/object-store.h
@@ -70,6 +70,7 @@ struct packed_git {
size_t index_size;
uint32_t num_objects;
uint32_t num_bad_objects;
+ uint32_t crc_offset;
unsigned char *bad_object_sha1;
int index_version;
time_t mtime;