Skip to content

Commit 245abe3

Browse files
jonathantanmygitster
authored andcommitted
clone, fetch: remove redundant transport check
Prior to commit a2d725b ("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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1700786 commit 245abe3

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

builtin/clone.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,9 +1083,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
10831083
warning(_("--local is ignored"));
10841084
transport->cloning = 1;
10851085

1086-
if (!transport->get_refs_list || (!is_local && !transport->fetch))
1087-
die(_("Don't know how to clone %s"), transport->url);
1088-
10891086
transport_set_option(transport, TRANS_OPT_KEEP, "yes");
10901087

10911088
if (option_depth)

builtin/fetch.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,9 +1094,6 @@ static int do_fetch(struct transport *transport,
10941094
tags = TAGS_UNSET;
10951095
}
10961096

1097-
if (!transport->get_refs_list || !transport->fetch)
1098-
die(_("Don't know how to fetch from %s"), transport->url);
1099-
11001097
/* if not appending, truncate FETCH_HEAD */
11011098
if (!append && !dry_run) {
11021099
retcode = truncate_fetch_head();

0 commit comments

Comments
 (0)