summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 113edd3..82c16ca 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -1205,6 +1205,7 @@ static void process_args(struct packet_reader *request,
{
while (packet_reader_read(request) != PACKET_READ_FLUSH) {
const char *arg = request->line;
+ const char *p;
/* process want */
if (parse_want(arg))
@@ -1251,6 +1252,11 @@ static void process_args(struct packet_reader *request,
continue;
}
+ if (allow_filter && skip_prefix(arg, "filter ", &p)) {
+ parse_list_objects_filter(&filter_options, p);
+ continue;
+ }
+
/* ignore unknown lines maybe? */
die("unexpected line: '%s'", arg);
}
@@ -1430,7 +1436,14 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
int upload_pack_advertise(struct repository *r,
struct strbuf *value)
{
- if (value)
+ if (value) {
+ int allow_filter_value;
strbuf_addstr(value, "shallow");
+ if (!repo_config_get_bool(the_repository,
+ "uploadpack.allowfilter",
+ &allow_filter_value) &&
+ allow_filter_value)
+ strbuf_addstr(value, " filter");
+ }
return 1;
}