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

Function unpack_all

builtin/unpack-objects.c:581–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579}
580
581static void unpack_all(void)
582{
583 int i;
584 unsigned char *hdr = fill(sizeof(struct pack_header));
585 struct odb_transaction *transaction;
586
587 if (get_be32(hdr) != PACK_SIGNATURE)
588 die("bad pack file");
589 hdr += 4;
590 if (!pack_version_ok_native(get_be32(hdr)))
591 die("unknown pack file version %"PRIu32,
592 get_be32(hdr));
593 hdr += 4;
594 nr_objects = get_be32(hdr);
595 use(sizeof(struct pack_header));
596
597 if (!quiet)
598 progress = start_progress(the_repository,
599 _("Unpacking objects"), nr_objects);
600 CALLOC_ARRAY(obj_list, nr_objects);
601 transaction = odb_transaction_begin(the_repository->objects);
602 for (i = 0; i < nr_objects; i++) {
603 unpack_one(i);
604 display_progress(progress, i + 1);
605 }
606 odb_transaction_commit(transaction);
607 stop_progress(&progress);
608
609 if (delta_list)
610 die("unresolved deltas left after unpacking");
611}
612
613int cmd_unpack_objects(int argc,
614 const char **argv,

Callers 1

cmd_unpack_objectsFunction · 0.85

Calls 10

get_be32Function · 0.85
start_progressFunction · 0.85
odb_transaction_beginFunction · 0.85
unpack_oneFunction · 0.85
display_progressFunction · 0.85
odb_transaction_commitFunction · 0.85
stop_progressFunction · 0.85
fillFunction · 0.70
useFunction · 0.70
dieFunction · 0.50

Tested by

no test coverage detected