| 596 | } |
| 597 | |
| 598 | static void alias_all_urls(struct remote_state *remote_state) |
| 599 | { |
| 600 | int i, j; |
| 601 | for (i = 0; i < remote_state->remotes_nr; i++) { |
| 602 | int add_pushurl_aliases; |
| 603 | if (!remote_state->remotes[i]) |
| 604 | continue; |
| 605 | for (j = 0; j < remote_state->remotes[i]->pushurl.nr; j++) { |
| 606 | char *alias = alias_url(remote_state->remotes[i]->pushurl.v[j], |
| 607 | &remote_state->rewrites); |
| 608 | if (alias) |
| 609 | strvec_replace(&remote_state->remotes[i]->pushurl, |
| 610 | j, alias); |
| 611 | free(alias); |
| 612 | } |
| 613 | add_pushurl_aliases = remote_state->remotes[i]->pushurl.nr == 0; |
| 614 | for (j = 0; j < remote_state->remotes[i]->url.nr; j++) { |
| 615 | char *alias; |
| 616 | if (add_pushurl_aliases) |
| 617 | add_pushurl_alias( |
| 618 | remote_state, remote_state->remotes[i], |
| 619 | remote_state->remotes[i]->url.v[j]); |
| 620 | alias = alias_url(remote_state->remotes[i]->url.v[j], |
| 621 | &remote_state->rewrites); |
| 622 | if (alias) |
| 623 | strvec_replace(&remote_state->remotes[i]->url, |
| 624 | j, alias); |
| 625 | free(alias); |
| 626 | } |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | static void read_config(struct repository *repo, int early) |
| 631 | { |
no test coverage detected