| 628 | } |
| 629 | |
| 630 | static void read_config(struct repository *repo, int early) |
| 631 | { |
| 632 | int flag; |
| 633 | |
| 634 | if (repo->remote_state->initialized) |
| 635 | return; |
| 636 | repo->remote_state->initialized = 1; |
| 637 | |
| 638 | repo->remote_state->current_branch = NULL; |
| 639 | if (startup_info->have_repository && !early) { |
| 640 | const char *head_ref = refs_resolve_ref_unsafe( |
| 641 | get_main_ref_store(repo), "HEAD", 0, NULL, &flag); |
| 642 | if (head_ref && (flag & REF_ISSYMREF) && |
| 643 | skip_prefix(head_ref, "refs/heads/", &head_ref)) { |
| 644 | repo->remote_state->current_branch = make_branch( |
| 645 | repo->remote_state, head_ref, strlen(head_ref)); |
| 646 | } |
| 647 | } |
| 648 | repo_config(repo, handle_config, repo->remote_state); |
| 649 | alias_all_urls(repo->remote_state); |
| 650 | } |
| 651 | |
| 652 | #ifndef WITH_BREAKING_CHANGES |
| 653 | static int valid_remote_nick(const char *name) |
no test coverage detected