diff options
author | Josh Steadmon <steadmon@google.com> | 2019-01-08 01:17:09 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-16 00:42:31 +0100 |
commit | 87c2d9d3102e6c388f2d29f1bdb0b3a222d9a707 (patch) | |
tree | bfc01fed555a7f00b7ad226bed3ffafd0d70f2c0 /transport-helper.c | |
parent | tree:<depth>: skip some trees even when collecting omits (diff) | |
download | git-87c2d9d3102e6c388f2d29f1bdb0b3a222d9a707.tar.xz git-87c2d9d3102e6c388f2d29f1bdb0b3a222d9a707.zip |
filter-options: expand scaled numbers
When communicating with a remote server or a subprocess, use
expanded numbers rather than numbers with scaling suffix in the
object filter spec (e.g. "limit:blob=1k" becomes
"limit:blob=1024").
Update the protocol docs to note that clients should always perform this
expansion, to allow for more compatibility between server
implementations.
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r-- | transport-helper.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/transport-helper.c b/transport-helper.c index bf225c698f..01404bfac5 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -679,10 +679,15 @@ static int fetch(struct transport *transport, if (data->transport_options.update_shallow) set_helper_option(transport, "update-shallow", "true"); - if (data->transport_options.filter_options.choice) - set_helper_option( - transport, "filter", - data->transport_options.filter_options.filter_spec); + if (data->transport_options.filter_options.choice) { + struct strbuf expanded_filter_spec = STRBUF_INIT; + expand_list_objects_filter_spec( + &data->transport_options.filter_options, + &expanded_filter_spec); + set_helper_option(transport, "filter", + expanded_filter_spec.buf); + strbuf_release(&expanded_filter_spec); + } if (data->transport_options.negotiation_tips) warning("Ignoring --negotiation-tip because the protocol does not support it."); |