aboutsummaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJosh Steadmon <steadmon@google.com>2019-01-07 16:17:09 -0800
committerJunio C Hamano <gitster@pobox.com>2019-01-15 15:42:31 -0800
commit87c2d9d3102e6c388f2d29f1bdb0b3a222d9a707 (patch)
treebfc01fed555a7f00b7ad226bed3ffafd0d70f2c0 /builtin/clone.c
parent8272f26034c9dbaf5cd216a137b8e91241cbc24e (diff)
downloadgit-87c2d9d3102e6c388f2d29f1bdb0b3a222d9a707.tar.xz
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 'builtin/clone.c')
-rw-r--r--builtin/clone.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 15b142d646..8e05e8ad6c 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1130,9 +1130,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)