From 72d0ea0056b8656765748a8bdeb42ee26ee1c8dc Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 15 Mar 2018 10:31:20 -0700 Subject: ls-refs: introduce ls-refs server command Introduce the ls-refs server command. In protocol v2, the ls-refs command is used to request the ref advertisement from the server. Since it is a command which can be requested (as opposed to mandatory in v1), a client can sent a number of parameters in its request to limit the ref advertisement based on provided ref-prefixes. Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- serve.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'serve.c') diff --git a/serve.c b/serve.c index 7ddcba9003..1cb5fb9b5b 100644 --- a/serve.c +++ b/serve.c @@ -4,8 +4,15 @@ #include "pkt-line.h" #include "version.h" #include "argv-array.h" +#include "ls-refs.h" #include "serve.h" +static int always_advertise(struct repository *r, + struct strbuf *value) +{ + return 1; +} + static int agent_advertise(struct repository *r, struct strbuf *value) { @@ -46,6 +53,7 @@ struct protocol_capability { static struct protocol_capability capabilities[] = { { "agent", agent_advertise, NULL }, + { "ls-refs", always_advertise, ls_refs }, }; static void advertise_capabilities(void) -- cgit v1.2.3