diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2019-08-13 21:37:43 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-13 23:33:54 +0300 |
commit | 7211b9e7534e021d7c46117ec0c64482e7930560 (patch) | |
tree | 57f3ae59a21af472b6bdc8e1482f6b8d1cfb879c /builtin/pack-objects.c | |
parent | 9c9b961d7eb15fb583a2a812088713a68a85f1c0 (diff) |
repo-settings: consolidate some config settings
There are a few important config settings that are not loaded
during git_default_config. These are instead loaded on-demand.
Centralize these config options to a single scan, and store
all of the values in a repo_settings struct. The values for
each setting are initialized as negative to indicate "unset".
This centralization will be particularly important in a later
change to introduce "meta" config settings that change the
defaults for these config settings.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r-- | builtin/pack-objects.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 267c562b1f8..f9f7181f3f8 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2709,10 +2709,6 @@ static int git_pack_config(const char *k, const char *v, void *cb) use_bitmap_index_default = git_config_bool(k, v); return 0; } - if (!strcmp(k, "pack.usesparse")) { - sparse = git_config_bool(k, v); - return 0; - } if (!strcmp(k, "pack.threads")) { delta_search_threads = git_config_int(k, v); if (delta_search_threads < 0) @@ -3332,6 +3328,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) read_replace_refs = 0; sparse = git_env_bool("GIT_TEST_PACK_SPARSE", 0); + prepare_repo_settings(the_repository); + if (!sparse && the_repository->settings.pack_use_sparse != -1) + sparse = the_repository->settings.pack_use_sparse; + reset_pack_idx_option(&pack_idx_opts); git_config(git_pack_config, NULL); |