summaryrefslogtreecommitdiff
path: root/serve.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-03-15 17:31:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-15 19:01:08 (GMT)
commit72d0ea0056b8656765748a8bdeb42ee26ee1c8dc (patch)
tree217681956effcfb8fb772c2d9ae297594ca1aea7 /serve.c
parented10cb952d315ae47d2f7f6f29333a9ee227bf6b (diff)
downloadgit-72d0ea0056b8656765748a8bdeb42ee26ee1c8dc.zip
git-72d0ea0056b8656765748a8bdeb42ee26ee1c8dc.tar.gz
git-72d0ea0056b8656765748a8bdeb42ee26ee1c8dc.tar.bz2
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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/serve.c b/serve.c
index 7ddcba9..1cb5fb9 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)