From: Junio C Hamano Date: Mon, 9 Sep 2013 21:50:37 +0000 (-0700) Subject: Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch' X-Git-Tag: v1.8.5-rc0~162 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20419de969b8ce0c49d133affdb1bb73eb62815e;p=git Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch' The auto-tag-following code in "git fetch" tries to reuse the same transport twice when the serving end does not cooperate and does not give tags that point to commits that are asked for as part of the primary transfer. Unfortunately, Git-aware transport helper interface is not designed to be used more than once, hence this does not work over smart-http transfer. * jc/transport-do-not-use-connect-twice-in-fetch: builtin/fetch.c: Fix a sparse warning fetch: work around "transport-take-over" hack fetch: refactor code that fetches leftover tags fetch: refactor code that prepares a transport fetch: rename file-scope global "transport" to "gtransport" t5802: add test for connect helper --- 20419de969b8ce0c49d133affdb1bb73eb62815e diff --cc builtin/fetch.c index 5936539552,564705555b..9e654efa3b --- a/builtin/fetch.c +++ b/builtin/fetch.c @@@ -965,26 -980,7 +996,18 @@@ static int fetch_one(struct remote *rem die(_("No remote repository specified. Please, specify either a URL or a\n" "remote name from which new revisions should be fetched.")); - transport = transport_get(remote, NULL); + gtransport = prepare_transport(remote); + + if (prune < 0) { + /* no command line request */ - if (0 <= transport->remote->prune) - prune = transport->remote->prune; ++ if (0 <= gtransport->remote->prune) ++ prune = gtransport->remote->prune; + else if (0 <= fetch_prune_config) + prune = fetch_prune_config; + else + prune = PRUNE_BY_DEFAULT; + } + - transport_set_verbosity(transport, verbosity, progress); - if (upload_pack) - set_option(TRANS_OPT_UPLOADPACK, upload_pack); - if (keep) - set_option(TRANS_OPT_KEEP, "yes"); - if (depth) - set_option(TRANS_OPT_DEPTH, depth); - if (argc > 0) { int j = 0; refs = xcalloc(argc + 1, sizeof(const char *));