diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2021-03-30 13:10:59 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-30 12:57:47 -0700 |
commit | 58300f4743231724686d9ddf481aeefa4f90d2f7 (patch) | |
tree | 0a73a7f7312d021f7891107d27f2ac0161e62202 /repo-settings.c | |
parent | 0938e6ff552510d4e6e495f062a9fab3e932178a (diff) | |
download | git-58300f4743231724686d9ddf481aeefa4f90d2f7.tar.gz |
sparse-index: add index.sparse config option
When enabled, this config option signals that index writes should
attempt to use sparse-directory entries.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repo-settings.c')
-rw-r--r-- | repo-settings.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/repo-settings.c b/repo-settings.c index d63569e404..0cfe8b787d 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -85,4 +85,11 @@ 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; } |