transport-helper: ask the helper to set the same options for import as for fetch
[gitweb.git] / transport-helper.c
index 23a741c60d861ad9ea7aa44a882712801f0dee1b..c3868e453183aa2a23dcd1a45c2b3d7b4fc0d274 100644 (file)
@@ -342,16 +342,6 @@ static int fetch_with_fetch(struct transport *transport,
        int i;
        struct strbuf buf = STRBUF_INIT;
 
-       if (data->check_connectivity &&
-           data->transport_options.check_self_contained_and_connected)
-               set_helper_option(transport, "check-connectivity", "true");
-
-       if (transport->cloning)
-               set_helper_option(transport, "cloning", "true");
-
-       if (data->transport_options.update_shallow)
-               set_helper_option(transport, "update-shallow", "true");
-
        for (i = 0; i < nr_heads; i++) {
                const struct ref *posn = to_fetch[i];
                if (posn->status & REF_STATUS_UPTODATE)
@@ -622,6 +612,16 @@ static int fetch(struct transport *transport,
        if (!count)
                return 0;
 
+       if (data->check_connectivity &&
+           data->transport_options.check_self_contained_and_connected)
+               set_helper_option(transport, "check-connectivity", "true");
+
+       if (transport->cloning)
+               set_helper_option(transport, "cloning", "true");
+
+       if (data->transport_options.update_shallow)
+               set_helper_option(transport, "update-shallow", "true");
+
        if (data->fetch)
                return fetch_with_fetch(transport, nr_heads, to_fetch);