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