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

Function http_fetch_pack

http-walker.c:425–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425static int http_fetch_pack(struct walker *walker, struct alt_base *repo,
426 const struct object_id *oid)
427{
428 struct packed_git *target;
429 int ret;
430 struct slot_results results;
431 struct http_pack_request *preq;
432
433 if (fetch_indices(walker, repo))
434 return -1;
435 target = packfile_list_find_oid(repo->packs.head, oid);
436 if (!target)
437 return -1;
438 close_pack_index(target);
439
440 if (walker->get_verbosely) {
441 fprintf(stderr, "Getting pack %s\n",
442 hash_to_hex(target->hash));
443 fprintf(stderr, " which contains %s\n",
444 oid_to_hex(oid));
445 }
446
447 preq = new_http_pack_request(target->hash, repo->base);
448 if (!preq)
449 goto abort;
450 preq->slot->results = &results;
451
452 if (start_active_slot(preq->slot)) {
453 run_active_slot(preq->slot);
454 if (results.curl_result != CURLE_OK) {
455 error("Unable to get pack file %s\n%s", preq->url,
456 curl_errorstr);
457 goto abort;
458 }
459 } else {
460 error("Unable to start request");
461 goto abort;
462 }
463
464 ret = finish_http_pack_request(preq);
465 release_http_pack_request(preq);
466 if (ret)
467 return ret;
468 http_install_packfile(target, &repo->packs);
469
470 return 0;
471
472abort:
473 return -1;
474}
475
476static void abort_object_request(struct object_request *obj_req)
477{

Callers 1

fetchFunction · 0.85

Calls 12

packfile_list_find_oidFunction · 0.85
close_pack_indexFunction · 0.85
hash_to_hexFunction · 0.85
oid_to_hexFunction · 0.85
new_http_pack_requestFunction · 0.85
start_active_slotFunction · 0.85
run_active_slotFunction · 0.85
errorFunction · 0.85
finish_http_pack_requestFunction · 0.85
http_install_packfileFunction · 0.85
fetch_indicesFunction · 0.70

Tested by

no test coverage detected