| 508 | } |
| 509 | |
| 510 | int send_pack(struct repository *r, |
| 511 | struct send_pack_args *args, |
| 512 | int fd[], struct child_process *conn, |
| 513 | struct ref *remote_refs, |
| 514 | struct oid_array *extra_have) |
| 515 | { |
| 516 | struct oid_array commons = OID_ARRAY_INIT; |
| 517 | int in = fd[0]; |
| 518 | int out = fd[1]; |
| 519 | struct strbuf req_buf = STRBUF_INIT; |
| 520 | struct strbuf cap_buf = STRBUF_INIT; |
| 521 | struct ref *ref; |
| 522 | int need_pack_data = 0; |
| 523 | int allow_deleting_refs = 0; |
| 524 | int status_report = 0; |
| 525 | int use_sideband = 0; |
| 526 | int quiet_supported = 0; |
| 527 | int agent_supported = 0; |
| 528 | int advertise_sid = 0; |
| 529 | int push_negotiate = 0; |
| 530 | int use_atomic = 0; |
| 531 | int atomic_supported = 0; |
| 532 | int use_push_options = 0; |
| 533 | int push_options_supported = 0; |
| 534 | int object_format_supported = 0; |
| 535 | unsigned cmds_sent = 0; |
| 536 | int ret; |
| 537 | struct async demux; |
| 538 | char *push_cert_nonce = NULL; |
| 539 | struct packet_reader reader; |
| 540 | int use_bitmaps; |
| 541 | |
| 542 | if (!remote_refs) { |
| 543 | fprintf(stderr, "No refs in common and none specified; doing nothing.\n" |
| 544 | "Perhaps you should specify a branch.\n"); |
| 545 | ret = 0; |
| 546 | goto out; |
| 547 | } |
| 548 | |
| 549 | repo_config_get_bool(r, "push.negotiate", &push_negotiate); |
| 550 | if (push_negotiate) { |
| 551 | trace2_region_enter("send_pack", "push_negotiate", r); |
| 552 | get_commons_through_negotiation(r, args->url, |
| 553 | args->negotiation_include, |
| 554 | args->negotiation_restrict, |
| 555 | remote_refs, &commons); |
| 556 | trace2_region_leave("send_pack", "push_negotiate", r); |
| 557 | } |
| 558 | |
| 559 | if (!repo_config_get_bool(r, "push.usebitmaps", &use_bitmaps)) |
| 560 | args->disable_bitmaps = !use_bitmaps; |
| 561 | |
| 562 | repo_config_get_bool(r, "transfer.advertisesid", &advertise_sid); |
| 563 | |
| 564 | /* Does the other end support the reporting? */ |
| 565 | if (server_supports("report-status-v2")) |
| 566 | status_report = 2; |
| 567 | else if (server_supports("report-status")) |
no test coverage detected