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

Function start_fetch_packed

http-push.c:307–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307static void start_fetch_packed(struct transfer_request *request)
308{
309 struct packed_git *target;
310
311 struct transfer_request *check_request = request_queue_head;
312 struct http_pack_request *preq;
313
314 target = packfile_list_find_oid(repo->packs.head, &request->obj->oid);
315 if (!target) {
316 fprintf(stderr, "Unable to fetch %s, will not be able to update server info refs\n", oid_to_hex(&request->obj->oid));
317 repo->can_update_info_refs = 0;
318 release_request(request);
319 return;
320 }
321 close_pack_index(target);
322 request->target = target;
323
324 fprintf(stderr, "Fetching pack %s\n",
325 hash_to_hex(target->hash));
326 fprintf(stderr, " which contains %s\n", oid_to_hex(&request->obj->oid));
327
328 preq = new_http_pack_request(target->hash, repo->url);
329 if (!preq) {
330 repo->can_update_info_refs = 0;
331 return;
332 }
333
334 /* Make sure there isn't another open request for this pack */
335 while (check_request) {
336 if (check_request->state == RUN_FETCH_PACKED &&
337 !strcmp(check_request->url, preq->url)) {
338 release_http_pack_request(preq);
339 release_request(request);
340 return;
341 }
342 check_request = check_request->next;
343 }
344
345 preq->slot->callback_func = process_response;
346 preq->slot->callback_data = request;
347 request->slot = preq->slot;
348 request->userData = preq;
349
350 /* Try to get the request started, abort the request on error */
351 request->state = RUN_FETCH_PACKED;
352 if (!start_active_slot(preq->slot)) {
353 fprintf(stderr, "Unable to start GET request\n");
354 release_http_pack_request(preq);
355 repo->can_update_info_refs = 0;
356 release_request(request);
357 }
358}
359
360static void start_put(struct transfer_request *request)
361{

Callers 1

finish_requestFunction · 0.85

Calls 8

packfile_list_find_oidFunction · 0.85
oid_to_hexFunction · 0.85
release_requestFunction · 0.85
close_pack_indexFunction · 0.85
hash_to_hexFunction · 0.85
new_http_pack_requestFunction · 0.85
start_active_slotFunction · 0.85

Tested by

no test coverage detected