Skip to content

Commit be94b33

Browse files
committed
Merge branch 'mh/transport-capabilities'
The transport-helper did not give transport options such as verbosity, progress, cloning, etc. to import and export based helpers, like it did for fetch and push based helpers, robbing them the chance to honor the wish of the end-users better. * mh/transport-capabilities: transport-helper: ask the helper to set the same options for import as for fetch transport-helper: ask the helper to set progress and verbosity options after asking for its capabilities
2 parents 33a2eea + aab1beb commit be94b33

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

transport-helper.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ static void do_take_over(struct transport *transport)
9797
free(data);
9898
}
9999

100+
static void standard_options(struct transport *t);
101+
100102
static struct child_process *get_helper(struct transport *transport)
101103
{
102104
struct helper_data *data = transport->data;
@@ -211,6 +213,7 @@ static struct child_process *get_helper(struct transport *transport)
211213
strbuf_release(&buf);
212214
if (debug)
213215
fprintf(stderr, "Debug: Capabilities complete.\n");
216+
standard_options(transport);
214217
return data->helper;
215218
}
216219

@@ -338,17 +341,6 @@ static int fetch_with_fetch(struct transport *transport,
338341
int i;
339342
struct strbuf buf = STRBUF_INIT;
340343

341-
standard_options(transport);
342-
if (data->check_connectivity &&
343-
data->transport_options.check_self_contained_and_connected)
344-
set_helper_option(transport, "check-connectivity", "true");
345-
346-
if (transport->cloning)
347-
set_helper_option(transport, "cloning", "true");
348-
349-
if (data->transport_options.update_shallow)
350-
set_helper_option(transport, "update-shallow", "true");
351-
352344
for (i = 0; i < nr_heads; i++) {
353345
const struct ref *posn = to_fetch[i];
354346
if (posn->status & REF_STATUS_UPTODATE)
@@ -622,6 +614,16 @@ static int fetch(struct transport *transport,
622614
if (!count)
623615
return 0;
624616

617+
if (data->check_connectivity &&
618+
data->transport_options.check_self_contained_and_connected)
619+
set_helper_option(transport, "check-connectivity", "true");
620+
621+
if (transport->cloning)
622+
set_helper_option(transport, "cloning", "true");
623+
624+
if (data->transport_options.update_shallow)
625+
set_helper_option(transport, "update-shallow", "true");
626+
625627
if (data->fetch)
626628
return fetch_with_fetch(transport, nr_heads, to_fetch);
627629

@@ -826,7 +828,6 @@ static int push_refs_with_push(struct transport *transport,
826828
return 0;
827829
}
828830

829-
standard_options(transport);
830831
for_each_string_list_item(cas_option, &cas_options)
831832
set_helper_option(transport, "cas", cas_option->string);
832833

0 commit comments

Comments
 (0)