summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2017-12-08 15:58:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-08 17:58:51 (GMT)
commitacb0c57260aa78fc99939de2a27c48b5a3fb4f21 (patch)
tree8151fc92e1f890f826294aad2328bfe22468b1c4 /remote-curl.c
parenta1743343f410290578fbd6e0ada50b8cdf1e7df8 (diff)
downloadgit-acb0c57260aa78fc99939de2a27c48b5a3fb4f21.zip
git-acb0c57260aa78fc99939de2a27c48b5a3fb4f21.tar.gz
git-acb0c57260aa78fc99939de2a27c48b5a3fb4f21.tar.bz2
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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 4318391..6ec5352 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++) {