clone, fetch: remove redundant transport check

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>

Jonathan Tan committed Dec 14, 2017 at 13:44 UTC 245abe34ac0622b349470b89d4b76a082a133cab
2 files changed -6
builtin/clone.c
-3
@@ -1083,9 +1083,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
1083 warning(_("--local is ignored"));
1084 transport->cloning = 1;
1085
1086 - if (!transport->get_refs_list || (!is_local && !transport->fetch))
1087 - die(_("Don't know how to clone %s"), transport->url);
1088 -
1086 transport_set_option(transport, TRANS_OPT_KEEP, "yes");
1087
1088 if (option_depth)
builtin/fetch.c
-3
@@ -1094,9 +1094,6 @@ static int do_fetch(struct transport *transport,
1094 tags = TAGS_UNSET;
1095 }
1096
1097 - if (!transport->get_refs_list || !transport->fetch)
1098 - die(_("Don't know how to fetch from %s"), transport->url);
1099 -
1097 /* if not appending, truncate FETCH_HEAD */
1098 if (!append && !dry_run) {
1099 retcode = truncate_fetch_head();