commit-graph: compute generation numbers
[gitweb.git] / remote-curl.c
index 431839111a9594174c6648d883f43eea9de89128..6ec535243565d4b1a50e22868966b4aec33776f8 100644 (file)
@@ -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++) {