Git fork

serve.[ch]: don't pass "struct strvec *keys" to commands

The serve.c API added in ed10cb952d3 (serve: introduce git-serve,
2018-03-15) was passing in the raw capabilities "keys", but nothing
downstream of it ever used them.

Let's remove that code because it's not needed. If we do end up
needing to pass information about the advertisement in the future
it'll make more sense to have serve.c parse the capabilities keys and
pass the result of its parsing, rather than expecting expecting its
API users to parse the same keys again.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Ævar Arnfjörð Bjarmason and committed by
Junio C Hamano
28a592e4 85baaed4

+9 -21
+1 -2
ls-refs.c
··· 138 138 return parse_hide_refs_config(var, value, "uploadpack"); 139 139 } 140 140 141 - int ls_refs(struct repository *r, struct strvec *keys, 142 - struct packet_reader *request) 141 + int ls_refs(struct repository *r, struct packet_reader *request) 143 142 { 144 143 struct ls_refs_data data; 145 144
+1 -3
ls-refs.h
··· 2 2 #define LS_REFS_H 3 3 4 4 struct repository; 5 - struct strvec; 6 5 struct packet_reader; 7 - int ls_refs(struct repository *r, struct strvec *keys, 8 - struct packet_reader *request); 6 + int ls_refs(struct repository *r, struct packet_reader *request); 9 7 int ls_refs_advertise(struct repository *r, struct strbuf *value); 10 8 11 9 #endif /* LS_REFS_H */
+1 -2
protocol-caps.c
··· 74 74 } 75 75 } 76 76 77 - int cap_object_info(struct repository *r, struct strvec *keys, 78 - struct packet_reader *request) 77 + int cap_object_info(struct repository *r, struct packet_reader *request) 79 78 { 80 79 struct requested_info info; 81 80 struct packet_writer writer;
+1 -3
protocol-caps.h
··· 2 2 #define PROTOCOL_CAPS_H 3 3 4 4 struct repository; 5 - struct strvec; 6 5 struct packet_reader; 7 - int cap_object_info(struct repository *r, struct strvec *keys, 8 - struct packet_reader *request); 6 + int cap_object_info(struct repository *r, struct packet_reader *request); 9 7 10 8 #endif /* PROTOCOL_CAPS_H */
+3 -6
serve.c
··· 60 60 61 61 /* 62 62 * Function called when a client requests the capability as a command. 63 - * The function will be provided the capabilities requested via 'keys' 64 - * as well as a struct packet_reader 'request' which the command should 63 + * Will be provided a struct packet_reader 'request' which it should 65 64 * use to read the command specific part of the request. Every command 66 65 * MUST read until a flush packet is seen before sending a response. 67 66 * 68 67 * This field should be NULL for capabilities which are not commands. 69 68 */ 70 - int (*command)(struct repository *r, 71 - struct strvec *keys, 72 - struct packet_reader *request); 69 + int (*command)(struct repository *r, struct packet_reader *request); 73 70 }; 74 71 75 72 static struct protocol_capability capabilities[] = { ··· 294 291 if (has_capability(&keys, "session-id", &client_sid)) 295 292 trace2_data_string("transfer", NULL, "client-sid", client_sid); 296 293 297 - command->command(the_repository, &keys, &reader); 294 + command->command(the_repository, &reader); 298 295 299 296 strvec_clear(&keys); 300 297 return 0;
+1 -2
upload-pack.c
··· 1655 1655 FETCH_DONE, 1656 1656 }; 1657 1657 1658 - int upload_pack_v2(struct repository *r, struct strvec *keys, 1659 - struct packet_reader *request) 1658 + int upload_pack_v2(struct repository *r, struct packet_reader *request) 1660 1659 { 1661 1660 enum fetch_state state = FETCH_PROCESS_ARGS; 1662 1661 struct upload_pack_data data;
+1 -3
upload-pack.h
··· 11 11 void upload_pack(struct upload_pack_options *options); 12 12 13 13 struct repository; 14 - struct strvec; 15 14 struct packet_reader; 16 - int upload_pack_v2(struct repository *r, struct strvec *keys, 17 - struct packet_reader *request); 15 + int upload_pack_v2(struct repository *r, struct packet_reader *request); 18 16 19 17 struct strbuf; 20 18 int upload_pack_advertise(struct repository *r,