]> Pileus Git - ~andy/git/blobdiff - builtin/clone.c
clone: always set transport options
[~andy/git] / builtin / clone.c
index 72cc40a1cc51816b6e10536e2f5e5ecdd5351f16..63f298be9c991e50e476f21cdbbc333d849a734a 100644 (file)
@@ -885,27 +885,25 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        remote = remote_get(option_origin);
        transport = transport_get(remote, remote->url[0]);
 
-       if (!is_local) {
-               if (!transport->get_refs_list || !transport->fetch)
-                       die(_("Don't know how to clone %s"), transport->url);
+       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");
+       transport_set_option(transport, TRANS_OPT_KEEP, "yes");
 
-               if (option_depth)
-                       transport_set_option(transport, TRANS_OPT_DEPTH,
-                                            option_depth);
-               if (option_single_branch)
-                       transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, "1");
+       if (option_depth)
+               transport_set_option(transport, TRANS_OPT_DEPTH,
+                                    option_depth);
+       if (option_single_branch)
+               transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, "1");
 
-               transport_set_verbosity(transport, option_verbosity, option_progress);
+       transport_set_verbosity(transport, option_verbosity, option_progress);
 
-               if (option_upload_pack)
-                       transport_set_option(transport, TRANS_OPT_UPLOADPACK,
-                                            option_upload_pack);
+       if (option_upload_pack)
+               transport_set_option(transport, TRANS_OPT_UPLOADPACK,
+                                    option_upload_pack);
 
-               if (transport->smart_options && !option_depth)
-                       transport->smart_options->check_self_contained_and_connected = 1;
-       }
+       if (transport->smart_options && !option_depth)
+               transport->smart_options->check_self_contained_and_connected = 1;
 
        refs = transport_get_remote_refs(transport);