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

Function fetch_single_packfile

http-fetch.c:55–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static void fetch_single_packfile(struct object_id *packfile_hash,
56 const char *url,
57 const char **index_pack_args) {
58 struct http_pack_request *preq;
59 struct slot_results results;
60 int ret;
61
62 http_init(NULL, url, 0);
63
64 preq = new_direct_http_pack_request(packfile_hash->hash, xstrdup(url));
65 if (!preq)
66 die("couldn't create http pack request");
67 preq->slot->results = &results;
68 preq->index_pack_args = index_pack_args;
69 preq->preserve_index_pack_stdout = 1;
70
71 if (start_active_slot(preq->slot)) {
72 run_active_slot(preq->slot);
73 if (results.curl_result != CURLE_OK) {
74 struct url_info url;
75 char *nurl = url_normalize(preq->url, &url);
76 if (!nurl || !git_env_bool("GIT_TRACE_REDACT", 1)) {
77 die("unable to get pack file '%s'\n%s", preq->url,
78 curl_errorstr);
79 } else {
80 die("failed to get '%.*s' url from '%.*s' "
81 "(full URL redacted due to GIT_TRACE_REDACT setting)\n%s",
82 (int)url.scheme_len, url.url,
83 (int)url.host_len, &url.url[url.host_off], curl_errorstr);
84 }
85 }
86 } else {
87 die("Unable to start request");
88 }
89
90 if ((ret = finish_http_pack_request(preq)))
91 die("finish_http_pack_request gave result %d", ret);
92
93 release_http_pack_request(preq);
94 http_cleanup();
95}
96
97int cmd_main(int argc, const char **argv)
98{

Callers 1

cmd_mainFunction · 0.85

Calls 11

http_initFunction · 0.85
xstrdupFunction · 0.85
start_active_slotFunction · 0.85
run_active_slotFunction · 0.85
url_normalizeFunction · 0.85
git_env_boolFunction · 0.85
finish_http_pack_requestFunction · 0.85
http_cleanupFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected