diff options
author | Brandon Williams <bmwill@google.com> | 2018-03-15 18:31:20 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-15 20:01:08 +0100 |
commit | 72d0ea0056b8656765748a8bdeb42ee26ee1c8dc (patch) | |
tree | 217681956effcfb8fb772c2d9ae297594ca1aea7 /serve.c | |
parent | serve: introduce git-serve (diff) | |
download | git-72d0ea0056b8656765748a8bdeb42ee26ee1c8dc.tar.xz git-72d0ea0056b8656765748a8bdeb42ee26ee1c8dc.zip |
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 <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'serve.c')
-rw-r--r-- | serve.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) |