MCPcopy Create free account
hub / github.com/git/git / alias_all_urls

Function alias_all_urls

remote.c:598–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596}
597
598static 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
630static void read_config(struct repository *repo, int early)
631{

Callers 1

read_configFunction · 0.85

Calls 3

alias_urlFunction · 0.85
strvec_replaceFunction · 0.85
add_pushurl_aliasFunction · 0.85

Tested by

no test coverage detected