diff options
author | René Scharfe <l.s.r@web.de> | 2021-09-11 22:43:26 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-12 16:14:32 -0700 |
commit | 09ef66179b943d03cbe0bea0603e5f40574695a1 (patch) | |
tree | 3cab775a4486a21314d5e536aae76c7a76be186e /object-store.h | |
parent | 7407d733a4a99cf946cab0c82e03c41dbd305b7c (diff) | |
download | git-09ef66179b943d03cbe0bea0603e5f40574695a1.tar.gz |
packfile: use oidset for bad objects
Store the object ID of broken pack entries in an oidset instead of
keeping only their hashes in an unsorted array. The resulting code is
shorter and easier to read. It also handles the (hopefully) very rare
case of having a high number of bad objects better.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-store.h')
-rw-r--r-- | object-store.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/object-store.h b/object-store.h index b4dc6668aa..c7bead66f6 100644 --- a/object-store.h +++ b/object-store.h @@ -10,6 +10,7 @@ #include "khash.h" #include "dir.h" #include "oidtree.h" +#include "oidset.h" struct object_directory { struct object_directory *next; @@ -75,9 +76,8 @@ struct packed_git { const void *index_data; size_t index_size; uint32_t num_objects; - uint32_t num_bad_objects; uint32_t crc_offset; - unsigned char *bad_object_sha1; + struct oidset bad_objects; int index_version; time_t mtime; int pack_fd; |