Skip to content

Commit

Permalink
Merge branch 'mh/transport-capabilities'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Feb 25, 2015
2 parents 33a2eea + aab1beb commit be94b33
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ static void do_take_over(struct transport *transport)
free(data);
}

static void standard_options(struct transport *t);

static struct child_process *get_helper(struct transport *transport)
{
struct helper_data *data = transport->data;
Expand Down Expand Up @@ -211,6 +213,7 @@ static struct child_process *get_helper(struct transport *transport)
strbuf_release(&buf);
if (debug)
fprintf(stderr, "Debug: Capabilities complete.\n");
standard_options(transport);
return data->helper;
}

Expand Down Expand Up @@ -338,17 +341,6 @@ static int fetch_with_fetch(struct transport *transport,
int i;
struct strbuf buf = STRBUF_INIT;

standard_options(transport);
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)
Expand Down Expand Up @@ -622,6 +614,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);

Expand Down Expand Up @@ -826,7 +828,6 @@ static int push_refs_with_push(struct transport *transport,
return 0;
}

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

Expand Down

0 comments on commit be94b33

Please sign in to comment.