mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
![Derrick Stolee](/assets/img/avatar_default.png)
Due to how Windows handles replacing a lockfile when there is an open handle, create the close_midx() method to close the existing midx before writing the new one. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
#ifndef __MIDX_H__
|
|
#define __MIDX_H__
|
|
|
|
#include "repository.h"
|
|
|
|
struct multi_pack_index {
|
|
struct multi_pack_index *next;
|
|
|
|
int fd;
|
|
|
|
const unsigned char *data;
|
|
size_t data_len;
|
|
|
|
uint32_t signature;
|
|
unsigned char version;
|
|
unsigned char hash_len;
|
|
unsigned char num_chunks;
|
|
uint32_t num_packs;
|
|
uint32_t num_objects;
|
|
|
|
const unsigned char *chunk_pack_names;
|
|
const uint32_t *chunk_oid_fanout;
|
|
const unsigned char *chunk_oid_lookup;
|
|
const unsigned char *chunk_object_offsets;
|
|
const unsigned char *chunk_large_offsets;
|
|
|
|
const char **pack_names;
|
|
struct packed_git **packs;
|
|
char object_dir[FLEX_ARRAY];
|
|
};
|
|
|
|
struct multi_pack_index *load_multi_pack_index(const char *object_dir);
|
|
int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
|
|
struct object_id *nth_midxed_object_oid(struct object_id *oid,
|
|
struct multi_pack_index *m,
|
|
uint32_t n);
|
|
int fill_midx_entry(const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
|
|
int midx_contains_pack(struct multi_pack_index *m, const char *idx_name);
|
|
int prepare_multi_pack_index_one(struct repository *r, const char *object_dir);
|
|
|
|
int write_midx_file(const char *object_dir);
|
|
|
|
#endif
|