diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2017-12-08 18:58:44 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-08 20:58:51 +0300 |
commit | acb0c57260aa78fc99939de2a27c48b5a3fb4f21 (patch) | |
tree | 8151fc92e1f890f826294aad2328bfe22468b1c4 /remote-curl.c | |
parent | a1743343f410290578fbd6e0ada50b8cdf1e7df8 (diff) |
fetch: support filters
Teach fetch to support filters. This is only allowed for the remote
configured in extensions.partialcloneremote.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r-- | remote-curl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/remote-curl.c b/remote-curl.c index 431839111a..6ec5352435 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -24,6 +24,7 @@ struct options { char *deepen_since; struct string_list deepen_not; struct string_list push_options; + char *filter; unsigned progress : 1, check_self_contained_and_connected : 1, cloning : 1, @@ -165,6 +166,9 @@ static int set_option(const char *name, const char *value) } else if (!strcmp(name, "no-dependents")) { options.no_dependents = 1; return 0; + } else if (!strcmp(name, "filter")) { + options.filter = xstrdup(value);; + return 0; } else { return 1 /* unsupported */; } @@ -834,6 +838,8 @@ static int fetch_git(struct discovery *heads, argv_array_push(&args, "--from-promisor"); if (options.no_dependents) argv_array_push(&args, "--no-dependents"); + if (options.filter) + argv_array_pushf(&args, "--filter=%s", options.filter); argv_array_push(&args, url.buf); for (i = 0; i < nr_heads; i++) { |