MCPcopy Index your code
hub / github.com/git/git / write_midx_header

Function write_midx_header

midx-write.c:36–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 const char *idx_name);
35
36static size_t write_midx_header(const struct git_hash_algo *hash_algo,
37 struct hashfile *f, unsigned char num_chunks,
38 uint32_t num_packs, int version)
39{
40 if (version != MIDX_VERSION_V1 && version != MIDX_VERSION_V2)
41 BUG("unexpected MIDX version: %d", version);
42
43 hashwrite_be32(f, MIDX_SIGNATURE);
44 hashwrite_u8(f, version);
45 hashwrite_u8(f, oid_version(hash_algo));
46 hashwrite_u8(f, num_chunks);
47 hashwrite_u8(f, 0); /* unused */
48 hashwrite_be32(f, num_packs);
49
50 return MIDX_HEADER_SIZE;
51}
52
53struct pack_info {
54 uint32_t orig_pack_int_id;

Callers 1

write_midx_internalFunction · 0.85

Calls 3

hashwrite_be32Function · 0.85
hashwrite_u8Function · 0.85
oid_versionFunction · 0.85

Tested by

no test coverage detected