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

Function fetch_refs_from_bundle

transport.c:188–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188static int fetch_refs_from_bundle(struct transport *transport,
189 int nr_heads UNUSED,
190 struct ref **to_fetch UNUSED)
191{
192 struct unbundle_opts opts = {
193 .flags = fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0,
194 };
195 struct bundle_transport_data *data = transport->data;
196 struct strvec extra_index_pack_args = STRVEC_INIT;
197 struct strbuf msg_types = STRBUF_INIT;
198 int ret;
199
200 if (transport->progress)
201 strvec_push(&extra_index_pack_args, "-v");
202
203 if (!data->get_refs_from_bundle_called)
204 get_refs_from_bundle_inner(transport);
205
206 repo_config(the_repository, fetch_fsck_config_cb, &msg_types);
207 opts.fsck_msg_types = msg_types.buf;
208
209 ret = unbundle(the_repository, &data->header, data->fd,
210 &extra_index_pack_args, &opts);
211 data->fd = -1; /* `unbundle()` closes the file descriptor */
212 transport->hash_algo = data->header.hash_algo;
213
214 strvec_clear(&extra_index_pack_args);
215 strbuf_release(&msg_types);
216 return ret;
217}
218
219static int close_bundle(struct transport *transport)
220{

Callers

nothing calls this directly

Calls 7

fetch_pack_fsck_objectsFunction · 0.85
strvec_pushFunction · 0.85
unbundleFunction · 0.85
strvec_clearFunction · 0.85
strbuf_releaseFunction · 0.85
repo_configFunction · 0.70

Tested by

no test coverage detected