upload-pack: pass upload_pack_data to upload_pack_config()
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's pass that struct to upload_pack_config(), so that this function can use all the fields of the struct. This will be used in followup commits to move static variables that are set in upload_pack_config() into 'upload_pack_data'. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e9d882b81e
commit
8a0e6f16ca
@ -1113,7 +1113,7 @@ static int find_symref(const char *refname, const struct object_id *oid,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int upload_pack_config(const char *var, const char *value, void *unused)
|
static int upload_pack_config(const char *var, const char *value, void *cb_data)
|
||||||
{
|
{
|
||||||
if (!strcmp("uploadpack.allowtipsha1inwant", var)) {
|
if (!strcmp("uploadpack.allowtipsha1inwant", var)) {
|
||||||
if (git_config_bool(var, value))
|
if (git_config_bool(var, value))
|
||||||
@ -1158,10 +1158,10 @@ void upload_pack(struct upload_pack_options *options)
|
|||||||
struct packet_reader reader;
|
struct packet_reader reader;
|
||||||
struct upload_pack_data data;
|
struct upload_pack_data data;
|
||||||
|
|
||||||
git_config(upload_pack_config, NULL);
|
|
||||||
|
|
||||||
upload_pack_data_init(&data);
|
upload_pack_data_init(&data);
|
||||||
|
|
||||||
|
git_config(upload_pack_config, &data);
|
||||||
|
|
||||||
data.stateless_rpc = options->stateless_rpc;
|
data.stateless_rpc = options->stateless_rpc;
|
||||||
data.daemon_mode = options->daemon_mode;
|
data.daemon_mode = options->daemon_mode;
|
||||||
data.timeout = options->timeout;
|
data.timeout = options->timeout;
|
||||||
@ -1491,11 +1491,11 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
|
|||||||
|
|
||||||
clear_object_flags(ALL_FLAGS);
|
clear_object_flags(ALL_FLAGS);
|
||||||
|
|
||||||
git_config(upload_pack_config, NULL);
|
|
||||||
|
|
||||||
upload_pack_data_init(&data);
|
upload_pack_data_init(&data);
|
||||||
data.use_sideband = LARGE_PACKET_MAX;
|
data.use_sideband = LARGE_PACKET_MAX;
|
||||||
|
|
||||||
|
git_config(upload_pack_config, &data);
|
||||||
|
|
||||||
while (state != FETCH_DONE) {
|
while (state != FETCH_DONE) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case FETCH_PROCESS_ARGS:
|
case FETCH_PROCESS_ARGS:
|
||||||
|
Reference in New Issue
Block a user