]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2013 21:50:37 +0000 (14:50 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2013 21:50:37 +0000 (14:50 -0700)
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

1  2 
builtin/fetch.c
transport.c
transport.h

diff --cc builtin/fetch.c
index 593653955201995227c062d3878aafc09b424940,564705555b897bde0a1a2c3fad3c1f1b39903b53..9e654efa3bb725edd91f6eb7059b263668e622bc
@@@ -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 *));
diff --cc transport.c
Simple merge
diff --cc transport.h
Simple merge