diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fetch.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 80bb143707..7cc7a52dee 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -351,7 +351,15 @@ static struct ref *get_ref_map(struct transport *transport, const struct ref *remote_refs; - refspec_ref_prefixes(rs, &ref_prefixes); + if (rs->nr) + refspec_ref_prefixes(rs, &ref_prefixes); + else if (transport->remote && transport->remote->fetch.nr) + refspec_ref_prefixes(&transport->remote->fetch, &ref_prefixes); + + if (ref_prefixes.argc && + (tags == TAGS_SET || (tags == TAGS_DEFAULT && !rs->nr))) { + argv_array_push(&ref_prefixes, "refs/tags/"); + } remote_refs = transport_get_remote_refs(transport, &ref_prefixes); |