summaryrefslogtreecommitdiff
path: root/repo-settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'repo-settings.c')
-rw-r--r--repo-settings.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/repo-settings.c b/repo-settings.c
index f7fff0f5ab..0cfe8b787d 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -77,4 +77,19 @@ void prepare_repo_settings(struct repository *r)
UPDATE_DEFAULT_BOOL(r->settings.core_untracked_cache, UNTRACKED_CACHE_KEEP);
UPDATE_DEFAULT_BOOL(r->settings.fetch_negotiation_algorithm, FETCH_NEGOTIATION_DEFAULT);
+
+ /*
+ * This setting guards all index reads to require a full index
+ * over a sparse index. After suitable guards are placed in the
+ * codebase around uses of the index, this setting will be
+ * 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;
}