X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Ffetch.c;h=d35f000c034964ed600b1d8d45e2ef9260abcfb6;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=fab3fce5122fc8ea8da0688e4b0e207ce4097127;hpb=381b2e76985de1c3670ec3c1938fef679c6eef17;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))