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

Function cmd_unpack_objects

builtin/unpack-objects.c:613–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613int cmd_unpack_objects(int argc,
614 const char **argv,
615 const char *prefix UNUSED,
616 struct repository *repo)
617{
618 int i;
619 struct object_id oid;
620 struct git_hash_ctx tmp_ctx;
621
622 disable_replace_refs();
623
624 repo_config(the_repository, git_default_config, NULL);
625
626 quiet = !isatty(2);
627
628 show_usage_if_asked(argc, argv, unpack_usage);
629
630 fsck_options_init(&fsck_options, repo, FSCK_OPTIONS_STRICT);
631
632 for (i = 1 ; i < argc; i++) {
633 const char *arg = argv[i];
634
635 if (*arg == '-') {
636 if (!strcmp(arg, "-n")) {
637 dry_run = 1;
638 continue;
639 }
640 if (!strcmp(arg, "-q")) {
641 quiet = 1;
642 continue;
643 }
644 if (!strcmp(arg, "-r")) {
645 recover = 1;
646 continue;
647 }
648 if (!strcmp(arg, "--strict")) {
649 strict = 1;
650 continue;
651 }
652 if (skip_prefix(arg, "--strict=", &arg)) {
653 strict = 1;
654 fsck_set_msg_types(&fsck_options, arg);
655 continue;
656 }
657 if (skip_prefix(arg, "--pack_header=", &arg)) {
658 if (parse_pack_header_option(arg,
659 buffer, &len) < 0)
660 die(_("bad --pack_header: %s"), arg);
661 continue;
662 }
663 if (skip_prefix(arg, "--max-input-size=", &arg)) {
664 max_input_size = strtoumax(arg, NULL, 10);
665 continue;
666 }
667 usage(unpack_usage);
668 }
669
670 /* We don't take any non-flag arguments now.. Maybe some day */

Callers

nothing calls this directly

Calls 15

disable_replace_refsFunction · 0.85
show_usage_if_askedFunction · 0.85
fsck_options_initFunction · 0.85
fsck_set_msg_typesFunction · 0.85
parse_pack_header_optionFunction · 0.85
unpack_allFunction · 0.85
git_hash_updateFunction · 0.85
git_hash_cloneFunction · 0.85
git_hash_final_oidFunction · 0.85
write_restFunction · 0.85
fsck_finishFunction · 0.85
hasheqFunction · 0.85

Tested by

no test coverage detected