Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-08-05 04:25:37 +0300
committerJunio C Hamano <gitster@pobox.com>2021-08-05 18:59:37 +0300
commit85baaed4757860eb54e6451be305bfb7ef863646 (patch)
tree2b0146f7f0f3c5d6f7643e434d74f741c9977f83 /serve.c
parent1fd88224a310f91c7ccac480473df40979d91f92 (diff)
serve: use designated initializers
Change the declaration of the protocol_capability struct to use designated initializers, this makes this more verbose now, but a follow-up commit will add a new field. At that point these lines would be too dense to be on one line comfortably. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'serve.c')
-rw-r--r--serve.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/serve.c b/serve.c
index 7bf5f23ea6..33d00c8c63 100644
--- a/serve.c
+++ b/serve.c
@@ -73,13 +73,37 @@ struct protocol_capability {
};
static struct protocol_capability capabilities[] = {
- { "agent", agent_advertise, NULL },
- { "ls-refs", ls_refs_advertise, ls_refs },
- { "fetch", upload_pack_advertise, upload_pack_v2 },
- { "server-option", always_advertise, NULL },
- { "object-format", object_format_advertise, NULL },
- { "session-id", session_id_advertise, NULL },
- { "object-info", always_advertise, cap_object_info },
+ {
+ .name = "agent",
+ .advertise = agent_advertise,
+ },
+ {
+ .name = "ls-refs",
+ .advertise = ls_refs_advertise,
+ .command = ls_refs,
+ },
+ {
+ .name = "fetch",
+ .advertise = upload_pack_advertise,
+ .command = upload_pack_v2,
+ },
+ {
+ .name = "server-option",
+ .advertise = always_advertise,
+ },
+ {
+ .name = "object-format",
+ .advertise = object_format_advertise,
+ },
+ {
+ .name = "session-id",
+ .advertise = session_id_advertise,
+ },
+ {
+ .name = "object-info",
+ .advertise = always_advertise,
+ .command = cap_object_info,
+ },
};
static void advertise_capabilities(void)