]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/clone.c
Sync with 2.36.5
[thirdparty/git.git] / builtin / clone.c
index 3af7dc01bd7ecdabcb1b56c71c69c3261e53cc07..cb981e0f0ed3d626dccdc55f2f262b65bc071904 100644 (file)
@@ -1160,10 +1160,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        refspec_appendf(&remote->fetch, "+%s*:%s*", src_ref_prefix,
                        branch_top.buf);
 
-       transport = transport_get(remote, remote->url[0]);
-       transport_set_verbosity(transport, option_verbosity, option_progress);
-       transport->family = family;
-
        path = get_repo_path(remote->url[0], &is_bundle);
        is_local = option_local != 0 && path && !is_bundle;
        if (is_local) {
@@ -1185,6 +1181,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        }
        if (option_local > 0 && !is_local)
                warning(_("--local is ignored"));
+
+       transport = transport_get(remote, path ? path : remote->url[0]);
+       transport_set_verbosity(transport, option_verbosity, option_progress);
+       transport->family = family;
        transport->cloning = 1;
 
        if (is_bundle) {