Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-09-11 23:43:26 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-13 02:14:32 +0300
commit09ef66179b943d03cbe0bea0603e5f40574695a1 (patch)
tree3cab775a4486a21314d5e536aae76c7a76be186e /object-store.h
parent7407d733a4a99cf946cab0c82e03c41dbd305b7c (diff)
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.h4
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;