]> git.ipfire.org Git - thirdparty/git.git/commitdiff
clone, fetch: remove redundant transport check
authorJonathan Tan <jonathantanmy@google.com>
Thu, 14 Dec 2017 21:44:44 +0000 (13:44 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Dec 2017 22:28:02 +0000 (14:28 -0800)
Prior to commit a2d725b7bdf7 ("Use an external program to implement
fetching with curl", 2009-08-05), if Git was compiled with NO_CURL, the
get_refs_list and fetch methods in struct transport might not be
populated, hence the checks in clone and fetch. After that commit, all
transports populate get_refs_list and fetch, making the checks in clone
and fetch redundant. Remove those checks.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c
builtin/fetch.c

index dbddd98f80d6660f2cde190a0e121022f079071d..979af0383dc9e93430a105698ce8a55970907d76 100644 (file)
@@ -1083,9 +1083,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                warning(_("--local is ignored"));
        transport->cloning = 1;
 
-       if (!transport->get_refs_list || (!is_local && !transport->fetch))
-               die(_("Don't know how to clone %s"), transport->url);
-
        transport_set_option(transport, TRANS_OPT_KEEP, "yes");
 
        if (option_depth)
index 225c734924f14854784cbc1e310f2fb817f1f38b..09eb1fc1712f20e93dbeefc979294c79f83684c9 100644 (file)
@@ -1094,9 +1094,6 @@ static int do_fetch(struct transport *transport,
                        tags = TAGS_UNSET;
        }
 
-       if (!transport->get_refs_list || !transport->fetch)
-               die(_("Don't know how to fetch from %s"), transport->url);
-
        /* if not appending, truncate FETCH_HEAD */
        if (!append && !dry_run) {
                retcode = truncate_fetch_head();