MCPcopy Create free account
hub / github.com/git/git / write_midx_large_offsets

Function write_midx_large_offsets

midx-write.c:591–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591static int write_midx_large_offsets(struct hashfile *f,
592 void *data)
593{
594 struct write_midx_context *ctx = data;
595 struct pack_midx_entry *list = ctx->entries;
596 struct pack_midx_entry *end = ctx->entries + ctx->entries_nr;
597 uint32_t nr_large_offset = ctx->num_large_offsets;
598
599 while (nr_large_offset) {
600 struct pack_midx_entry *obj;
601 uint64_t offset;
602
603 if (list >= end)
604 BUG("too many large-offset objects");
605
606 obj = list++;
607 offset = obj->offset;
608
609 if (!(offset >> 31))
610 continue;
611
612 hashwrite_be64(f, offset);
613
614 nr_large_offset--;
615 }
616
617 return 0;
618}
619
620static int write_midx_revindex(struct hashfile *f,
621 void *data)

Callers

nothing calls this directly

Calls 1

hashwrite_be64Function · 0.85

Tested by

no test coverage detected