diff options
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index b8a58fa7a5..655ee64256 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "lockfile.h" #include "refs.h" #include "pkt-line.h" #include "commit.h" @@ -666,7 +667,7 @@ static int get_pack(struct fetch_pack_args *args, char hdr_arg[256]; const char **av, *cmd_name; int do_keep = args->keep_pack; - struct child_process cmd; + struct child_process cmd = CHILD_PROCESS_INIT; int ret; memset(&demux, 0, sizeof(demux)); @@ -685,7 +686,6 @@ static int get_pack(struct fetch_pack_args *args, else demux.out = xd[0]; - memset(&cmd, 0, sizeof(cmd)); cmd.argv = argv; av = argv; *hdr_arg = 0; @@ -869,34 +869,15 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args, return ref; } -static int fetch_pack_config(const char *var, const char *value, void *cb) +static void fetch_pack_config(void) { - if (strcmp(var, "fetch.unpacklimit") == 0) { - fetch_unpack_limit = git_config_int(var, value); - return 0; - } - - if (strcmp(var, "transfer.unpacklimit") == 0) { - transfer_unpack_limit = git_config_int(var, value); - return 0; - } - - if (strcmp(var, "repack.usedeltabaseoffset") == 0) { - prefer_ofs_delta = git_config_bool(var, value); - return 0; - } - - if (!strcmp(var, "fetch.fsckobjects")) { - fetch_fsck_objects = git_config_bool(var, value); - return 0; - } - - if (!strcmp(var, "transfer.fsckobjects")) { - transfer_fsck_objects = git_config_bool(var, value); - return 0; - } + git_config_get_int("fetch.unpacklimit", &fetch_unpack_limit); + git_config_get_int("transfer.unpacklimit", &transfer_unpack_limit); + git_config_get_bool("repack.usedeltabaseoffset", &prefer_ofs_delta); + git_config_get_bool("fetch.fsckobjects", &fetch_fsck_objects); + git_config_get_bool("transfer.fsckobjects", &transfer_fsck_objects); - return git_default_config(var, value, cb); + git_config(git_default_config, NULL); } static void fetch_pack_setup(void) @@ -904,7 +885,7 @@ static void fetch_pack_setup(void) static int did_setup; if (did_setup) return; - git_config(fetch_pack_config, NULL); + fetch_pack_config(); if (0 <= transfer_unpack_limit) unpack_limit = transfer_unpack_limit; else if (0 <= fetch_unpack_limit) |