diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-02-06 01:26:09 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-06 01:26:10 +0300 |
commit | 073312b4c7a15d484d2ffdc2eb4a406df9cf9c55 (patch) | |
tree | 473d2508e4ba7d7e424445d2ddce2a9cf659ea46 /builtin | |
parent | b99a579f8e434a7757f90895945b5711b3f159d5 (diff) | |
parent | 87c2d9d3102e6c388f2d29f1bdb0b3a222d9a707 (diff) |
Merge branch 'js/filter-options-should-use-plain-int'
Update the protocol message specification to allow only the limited
use of scaled quantities. This is ensure potential compatibility
issues will not go out of hand.
* js/filter-options-should-use-plain-int:
filter-options: expand scaled numbers
tree:<depth>: skip some trees even when collecting omits
list-objects-filter: teach tree:# how to handle >0
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clone.c | 6 | ||||
-rw-r--r-- | builtin/fetch.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 7c7f98c72c8..739de68820c 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -1136,9 +1136,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix) option_upload_pack); if (filter_options.choice) { + struct strbuf expanded_filter_spec = STRBUF_INIT; + expand_list_objects_filter_spec(&filter_options, + &expanded_filter_spec); transport_set_option(transport, TRANS_OPT_LIST_OBJECTS_FILTER, - filter_options.filter_spec); + expanded_filter_spec.buf); transport_set_option(transport, TRANS_OPT_FROM_PROMISOR, "1"); + strbuf_release(&expanded_filter_spec); } if (transport->smart_options && !deepen && !filter_options.choice) diff --git a/builtin/fetch.c b/builtin/fetch.c index c316c03ba20..61a443031d9 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1165,6 +1165,7 @@ static void add_negotiation_tips(struct git_transport_options *smart_options) static struct transport *prepare_transport(struct remote *remote, int deepen) { struct transport *transport; + transport = transport_get(remote, NULL); transport_set_verbosity(transport, verbosity, progress); transport->family = family; @@ -1184,9 +1185,13 @@ static struct transport *prepare_transport(struct remote *remote, int deepen) if (update_shallow) set_option(transport, TRANS_OPT_UPDATE_SHALLOW, "yes"); if (filter_options.choice) { + struct strbuf expanded_filter_spec = STRBUF_INIT; + expand_list_objects_filter_spec(&filter_options, + &expanded_filter_spec); set_option(transport, TRANS_OPT_LIST_OBJECTS_FILTER, - filter_options.filter_spec); + expanded_filter_spec.buf); set_option(transport, TRANS_OPT_FROM_PROMISOR, "1"); + strbuf_release(&expanded_filter_spec); } if (negotiation_tip.nr) { if (transport->smart_options) |