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

Function cmd_fetch_pack

builtin/fetch-pack.c:49–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49int cmd_fetch_pack(int argc,
50 const char **argv,
51 const char *prefix UNUSED,
52 struct repository *repo UNUSED)
53{
54 int i, ret;
55 struct ref *fetched_refs = NULL, *remote_refs = NULL;
56 const char *dest = NULL;
57 struct ref **sought = NULL;
58 struct ref **sought_to_free = NULL;
59 int nr_sought = 0, alloc_sought = 0;
60 int fd[2];
61 struct string_list pack_lockfiles = STRING_LIST_INIT_DUP;
62 struct string_list *pack_lockfiles_ptr = NULL;
63 struct child_process *conn;
64 struct fetch_pack_args args;
65 struct oid_array shallow = OID_ARRAY_INIT;
66 struct string_list deepen_not = STRING_LIST_INIT_DUP;
67 struct packet_reader reader;
68 enum protocol_version version;
69
70 fetch_if_missing = 0;
71
72 packet_trace_identity("fetch-pack");
73
74 memset(&args, 0, sizeof(args));
75 list_objects_filter_init(&args.filter_options);
76 args.uploadpack = "git-upload-pack";
77
78 show_usage_if_asked(argc, argv, fetch_pack_usage);
79
80 for (i = 1; i < argc && *argv[i] == '-'; i++) {
81 const char *arg = argv[i];
82
83 if (skip_prefix(arg, "--upload-pack=", &arg)) {
84 args.uploadpack = arg;
85 continue;
86 }
87 if (skip_prefix(arg, "--exec=", &arg)) {
88 args.uploadpack = arg;
89 continue;
90 }
91 if (!strcmp("--quiet", arg) || !strcmp("-q", arg)) {
92 args.quiet = 1;
93 continue;
94 }
95 if (!strcmp("--keep", arg) || !strcmp("-k", arg)) {
96 args.lock_pack = args.keep_pack;
97 args.keep_pack = 1;
98 continue;
99 }
100 if (!strcmp("--thin", arg)) {
101 args.use_thin_pack = 1;
102 continue;
103 }
104 if (!strcmp("--include-tag", arg)) {
105 args.include_tag = 1;
106 continue;

Callers

nothing calls this directly

Calls 15

packet_trace_identityFunction · 0.85
list_objects_filter_initFunction · 0.85
show_usage_if_askedFunction · 0.85
xstrdupFunction · 0.85
add_sought_entryFunction · 0.85
packet_read_lineFunction · 0.85
strbuf_getline_lfFunction · 0.85
strbuf_releaseFunction · 0.85
git_connectFunction · 0.85
packet_reader_initFunction · 0.85

Tested by

no test coverage detected