THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8KB

  1. #ifndef MIDX_H
  2. #define MIDX_H
  3. #include "repository.h"
  4. struct object_id;
  5. struct pack_entry;
  6. struct repository;
  7. #define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX"
  8. struct multi_pack_index {
  9. struct multi_pack_index *next;
  10. int fd;
  11. const unsigned char *data;
  12. size_t data_len;
  13. uint32_t signature;
  14. unsigned char version;
  15. unsigned char hash_len;
  16. unsigned char num_chunks;
  17. uint32_t num_packs;
  18. uint32_t num_objects;
  19. int local;
  20. const unsigned char *chunk_pack_names;
  21. const uint32_t *chunk_oid_fanout;
  22. const unsigned char *chunk_oid_lookup;
  23. const unsigned char *chunk_object_offsets;
  24. const unsigned char *chunk_large_offsets;
  25. const char **pack_names;
  26. struct packed_git **packs;
  27. char object_dir[FLEX_ARRAY];
  28. };
  29. #define MIDX_PROGRESS (1 << 0)
  30. struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
  31. int prepare_midx_pack(struct repository *r, struct multi_pack_index *m, uint32_t pack_int_id);
  32. int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
  33. struct object_id *nth_midxed_object_oid(struct object_id *oid,
  34. struct multi_pack_index *m,
  35. uint32_t n);
  36. int fill_midx_entry(struct repository *r, const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
  37. int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name);
  38. int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
  39. int write_midx_file(const char *object_dir, unsigned flags);
  40. void clear_midx_file(struct repository *r);
  41. int verify_midx_file(struct repository *r, const char *object_dir, unsigned flags);
  42. int expire_midx_packs(struct repository *r, const char *object_dir, unsigned flags);
  43. int midx_repack(struct repository *r, const char *object_dir, size_t batch_size, unsigned flags);
  44. void close_midx(struct multi_pack_index *m);
  45. #endif