X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin%2Ffetch.c;h=d35f000c034964ed600b1d8d45e2ef9260abcfb6;hb=0bc6180bcbe6bd821ac8cf2178cb13ff628b4f69;hp=fab3fce5122fc8ea8da0688e4b0e207ce4097127;hpb=8aed4a5e38a2a4f31567e01ab2a73341e972c08a;p=git.git diff --git a/builtin/fetch.c b/builtin/fetch.c index fab3fce51..d35f000c0 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -16,7 +16,7 @@ static const char * const builtin_fetch_usage[] = { "git fetch [] [ [...]]", "git fetch [] ", - "git fetch --multiple [] [ | ]...", + "git fetch --multiple [] [( | )...]", "git fetch --all []", NULL }; @@ -146,7 +146,10 @@ static struct ref *get_ref_map(struct transport *transport, struct remote *remote = transport->remote; struct branch *branch = branch_get(NULL); int has_merge = branch_has_merge_config(branch); - if (remote && (remote->fetch_refspec_nr || has_merge)) { + if (remote && + (remote->fetch_refspec_nr || + /* Note: has_merge implies non-NULL branch->remote_name */ + (has_merge && !strcmp(branch->remote_name, remote->name)))) { for (i = 0; i < remote->fetch_refspec_nr; i++) { get_fetch_map(remote_refs, &remote->fetch[i], &tail, 0); if (remote->fetch[i].dst && @@ -160,6 +163,8 @@ static struct ref *get_ref_map(struct transport *transport, * if the remote we're fetching from is the same * as given in branch..remote, we add the * ref given in branch..merge, too. + * + * Note: has_merge implies non-NULL branch->remote_name */ if (has_merge && !strcmp(branch->remote_name, remote->name))