aboutsummaryrefslogtreecommitdiffstats
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-05 14:26:09 -0800
committerJunio C Hamano <gitster@pobox.com>2019-02-05 14:26:10 -0800
commit073312b4c7a15d484d2ffdc2eb4a406df9cf9c55 (patch)
tree473d2508e4ba7d7e424445d2ddce2a9cf659ea46 /fetch-pack.c
parentb99a579f8e434a7757f90895945b5711b3f159d5 (diff)
parent87c2d9d3102e6c388f2d29f1bdb0b3a222d9a707 (diff)
downloadgit-073312b4c7a15d484d2ffdc2eb4a406df9cf9c55.tar.gz
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 'fetch-pack.c')
-rw-r--r--fetch-pack.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 577faa6229..bf8984b8e8 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -329,9 +329,14 @@ static int find_common(struct fetch_negotiator *negotiator,
packet_buf_write(&req_buf, "deepen-not %s", s->string);
}
}
- if (server_supports_filtering && args->filter_options.choice)
+ if (server_supports_filtering && args->filter_options.choice) {
+ struct strbuf expanded_filter_spec = STRBUF_INIT;
+ expand_list_objects_filter_spec(&args->filter_options,
+ &expanded_filter_spec);
packet_buf_write(&req_buf, "filter %s",
- args->filter_options.filter_spec);
+ expanded_filter_spec.buf);
+ strbuf_release(&expanded_filter_spec);
+ }
packet_buf_flush(&req_buf);
state_len = req_buf.len;
@@ -1122,9 +1127,13 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,
/* Add filter */
if (server_supports_feature("fetch", "filter", 0) &&
args->filter_options.choice) {
+ struct strbuf expanded_filter_spec = STRBUF_INIT;
print_verbose(args, _("Server supports filter"));
+ expand_list_objects_filter_spec(&args->filter_options,
+ &expanded_filter_spec);
packet_buf_write(&req_buf, "filter %s",
- args->filter_options.filter_spec);
+ expanded_filter_spec.buf);
+ strbuf_release(&expanded_filter_spec);
} else if (args->filter_options.choice) {
warning("filtering not recognized by server, ignoring");
}