| 532 | } |
| 533 | |
| 534 | static void update_remote_refs(const struct ref *refs, |
| 535 | const struct ref *mapped_refs, |
| 536 | const struct ref *remote_head_points_at, |
| 537 | const char *branch_top, |
| 538 | const char *msg, |
| 539 | struct transport *transport, |
| 540 | int check_connectivity) |
| 541 | { |
| 542 | const struct ref *rm = mapped_refs; |
| 543 | |
| 544 | if (check_connectivity) { |
| 545 | struct check_connected_options opt = CHECK_CONNECTED_INIT; |
| 546 | |
| 547 | opt.transport = transport; |
| 548 | opt.progress = transport->progress; |
| 549 | |
| 550 | if (check_connected(iterate_ref_map, &rm, &opt)) |
| 551 | die(_("remote did not send all necessary objects")); |
| 552 | } |
| 553 | |
| 554 | if (refs) { |
| 555 | write_remote_refs(mapped_refs); |
| 556 | if (option_single_branch && option_tags) |
| 557 | write_followtags(refs, msg); |
| 558 | } |
| 559 | |
| 560 | if (remote_head_points_at && !option_bare) { |
| 561 | struct strbuf head_ref = STRBUF_INIT; |
| 562 | strbuf_addstr(&head_ref, branch_top); |
| 563 | strbuf_addstr(&head_ref, "HEAD"); |
| 564 | if (refs_update_symref(get_main_ref_store(the_repository), head_ref.buf, |
| 565 | remote_head_points_at->peer_ref->name, |
| 566 | msg) < 0) |
| 567 | die(_("unable to update %s"), head_ref.buf); |
| 568 | strbuf_release(&head_ref); |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | static void update_head(struct clone_opts *opts, const struct ref *our, const struct ref *remote, |
| 573 | const char *unborn, const char *msg) |
no test coverage detected