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

Function unbundle

bundle.c:606–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604}
605
606int unbundle(struct repository *r, struct bundle_header *header,
607 int bundle_fd, struct strvec *extra_index_pack_args,
608 struct unbundle_opts *opts)
609{
610 struct child_process ip = CHILD_PROCESS_INIT;
611 struct unbundle_opts opts_fallback = { 0 };
612
613 if (!opts)
614 opts = &opts_fallback;
615
616 if (verify_bundle(r, header, opts->flags)) {
617 close(bundle_fd);
618 return -1;
619 }
620
621 strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL);
622
623 /* If there is a filter, then we need to create the promisor pack. */
624 if (header->filter.choice)
625 strvec_push(&ip.args, "--promisor=from-bundle");
626
627 if (opts->flags & VERIFY_BUNDLE_FSCK)
628 strvec_pushf(&ip.args, "--fsck-objects%s",
629 opts->fsck_msg_types ? opts->fsck_msg_types : "");
630
631 if (extra_index_pack_args)
632 strvec_pushv(&ip.args, extra_index_pack_args->v);
633
634 ip.in = bundle_fd;
635 ip.no_stdout = 1;
636 ip.git_cmd = 1;
637 if (run_command(&ip))
638 return error(_("index-pack died"));
639 return 0;
640}

Callers 3

fetch_refs_from_bundleFunction · 0.85
unbundle_from_fileFunction · 0.85
cmd_bundle_unbundleFunction · 0.85

Calls 7

verify_bundleFunction · 0.85
strvec_pushlFunction · 0.85
strvec_pushFunction · 0.85
strvec_pushfFunction · 0.85
strvec_pushvFunction · 0.85
run_commandFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected