X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Ffetch.c;h=d35f000c034964ed600b1d8d45e2ef9260abcfb6;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=ea14d5dc6b00b475b8817768b7d35d0bb54d5236;hpb=613e4e5f4046ee36f40199cbaeb9f35442d24378;p=git.git diff --git a/builtin/fetch.c b/builtin/fetch.c index ea14d5dc6..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)) @@ -659,10 +664,12 @@ static int do_fetch(struct transport *transport, for_each_ref(add_existing, &existing_refs); - if (transport->remote->fetch_tags == 2 && tags != TAGS_UNSET) - tags = TAGS_SET; - if (transport->remote->fetch_tags == -1) - tags = TAGS_UNSET; + if (tags == TAGS_DEFAULT) { + if (transport->remote->fetch_tags == 2) + tags = TAGS_SET; + if (transport->remote->fetch_tags == -1) + tags = TAGS_UNSET; + } if (!transport->get_refs_list || !transport->fetch) die("Don't know how to fetch from %s", transport->url);