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

Function write_midx_oid_lookup

midx-write.c:536–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536static int write_midx_oid_lookup(struct hashfile *f,
537 void *data)
538{
539 struct write_midx_context *ctx = data;
540 unsigned char hash_len = ctx->repo->hash_algo->rawsz;
541 struct pack_midx_entry *list = ctx->entries;
542 uint32_t i;
543
544 for (i = 0; i < ctx->entries_nr; i++) {
545 struct pack_midx_entry *obj = list++;
546
547 if (i < ctx->entries_nr - 1) {
548 struct pack_midx_entry *next = list;
549 if (oidcmp(&obj->oid, &next->oid) >= 0)
550 BUG("OIDs not in order: %s >= %s",
551 oid_to_hex(&obj->oid),
552 oid_to_hex(&next->oid));
553 }
554
555 hashwrite(f, obj->oid.hash, (int)hash_len);
556 }
557
558 return 0;
559}
560
561static int write_midx_object_offsets(struct hashfile *f,
562 void *data)

Callers

nothing calls this directly

Calls 3

oidcmpFunction · 0.85
oid_to_hexFunction · 0.85
hashwriteFunction · 0.85

Tested by

no test coverage detected