summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--repo-settings.c8
-rw-r--r--repository.h5
2 files changed, 3 insertions, 10 deletions
diff --git a/repo-settings.c b/repo-settings.c
index 46b9d56aea..b93e91a212 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -45,6 +45,7 @@ void prepare_repo_settings(struct repository *r)
repo_cfg_bool(r, "fetch.writecommitgraph", &r->settings.fetch_write_commit_graph, 0);
repo_cfg_bool(r, "pack.usesparse", &r->settings.pack_use_sparse, 1);
repo_cfg_bool(r, "core.multipackindex", &r->settings.core_multi_pack_index, 1);
+ repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 0);
/*
* The GIT_TEST_MULTI_PACK_INDEX variable is special in that
@@ -90,11 +91,4 @@ void prepare_repo_settings(struct repository *r)
* removed.
*/
r->settings.command_requires_full_index = 1;
-
- /*
- * Initialize this as off.
- */
- r->settings.sparse_index = 0;
- if (!repo_config_get_bool(r, "index.sparse", &value) && value)
- r->settings.sparse_index = 1;
}
diff --git a/repository.h b/repository.h
index bf36744e0a..02599ae2c9 100644
--- a/repository.h
+++ b/repository.h
@@ -31,6 +31,8 @@ struct repo_settings {
int commit_graph_read_changed_paths;
int gc_write_commit_graph;
int fetch_write_commit_graph;
+ int command_requires_full_index;
+ int sparse_index;
int index_version;
enum untracked_cache_setting core_untracked_cache;
@@ -39,9 +41,6 @@ struct repo_settings {
enum fetch_negotiation_setting fetch_negotiation_algorithm;
int core_multi_pack_index;
-
- unsigned command_requires_full_index:1,
- sparse_index:1;
};
struct repository {