diff options
author | Mike Hommey <mh@glandium.org> | 2015-02-13 14:24:46 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-13 11:32:28 -0800 |
commit | aab1beb0e1a66d31b0a9896e8c13009dece0aa45 (patch) | |
tree | a5ce27f54dab96203fa5039fe1e05aa308a8eb42 /transport-helper.c | |
parent | 2879bc3b0c3acc89f0415ac0d0e3946599d9fc88 (diff) | |
download | git-aab1beb0e1a66d31b0a9896e8c13009dece0aa45.tar.gz |
transport-helper: ask the helper to set the same options for import as for fetchmh/transport-capabilities
A remote helper is currently only told about the 'check-connectivity',
'cloning', and 'update-shallow' options when it supports the 'fetch'
command, but not when it supports 'import' instead.
This is especially important for the 'cloning' option, because it
means a remote helper that only supports 'import' can't distinguish
between a clone and a pull besides doing some assumptions from the
git directory state.
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r-- | transport-helper.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/transport-helper.c b/transport-helper.c index 23a741c60d..c3868e4531 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -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); |