transport-helper: ask the helper to set progress and verbosity options after asking for its capabilities

Currently, a remote helper is only told about the progress and verbosity options for the 'fetch' and 'push' commands. This means a remote helper that implements 'import' and 'export' can never know the user requested progress or verbosity (or lack thereof) through the command line. Telling the remote helper about those options after asking for its capabilities ensures it can act accordingly for all commands. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mike Hommey committed Feb 13, 2015 at 14:24 UTC 2879bc3b0c3acc89f0415ac0d0e3946599d9fc88
1 file changed +3 -2
transport-helper.c
+3 -2
@@ -98,6 +98,8 @@ static void do_take_over(struct transport *transport)
98 free(data);
99 }
100
101 +static void standard_options(struct transport *t);
102 +
103 static struct child_process *get_helper(struct transport *transport)
104 {
105 struct helper_data *data = transport->data;
@@ -212,6 +214,7 @@ static struct child_process *get_helper(struct transport *transport)
214 strbuf_release(&buf);
215 if (debug)
216 fprintf(stderr, "Debug: Capabilities complete.\n");
217 + standard_options(transport);
218 return data->helper;
219 }
220
@@ -339,7 +342,6 @@ static int fetch_with_fetch(struct transport *transport,
342 int i;
343 struct strbuf buf = STRBUF_INIT;
344
342 - standard_options(transport);
345 if (data->check_connectivity &&
346 data->transport_options.check_self_contained_and_connected)
347 set_helper_option(transport, "check-connectivity", "true");
@@ -824,7 +826,6 @@ static int push_refs_with_push(struct transport *transport,
826 return 0;
827 }
828
827 - standard_options(transport);
829 for_each_string_list_item(cas_option, &cas_options)
830 set_helper_option(transport, "cas", cas_option->string);
831