From be6d99a83332482c68082cf1e44a7bba29650306 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Tue, 15 Jun 2021 11:07:11 -0400 Subject: [PATCH] repo-settings: enable sparse index by default There is some strangeness when expanding a sparse-index that exists within a submodule. We will need to resolve that later, but for now, let's do a better job of explicitly disabling the sparse-index when requested, and do so in t7817. Signed-off-by: Derrick Stolee --- repo-settings.c | 2 +- t/t1092-sparse-checkout-compatibility.sh | 1 + t/t7817-grep-sparse-checkout.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/repo-settings.c b/repo-settings.c index 459041f65c..ffeee85de0 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -74,7 +74,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); + repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 1); /* * The GIT_TEST_MULTI_PACK_INDEX variable is special in that diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh index f9f8c988bb..f5d25027f9 100755 --- a/t/t1092-sparse-checkout-compatibility.sh +++ b/t/t1092-sparse-checkout-compatibility.sh @@ -155,6 +155,7 @@ init_repos () { git -C sparse-index reset --hard && # initialize sparse-checkout definitions + git -C sparse-checkout config index.sparse false && git -C sparse-checkout sparse-checkout init --cone && git -C sparse-checkout sparse-checkout set deep && git -C sparse-index sparse-checkout init --cone --sparse-index && diff --git a/t/t7817-grep-sparse-checkout.sh b/t/t7817-grep-sparse-checkout.sh index eb59564565..db3004c4fe 100755 --- a/t/t7817-grep-sparse-checkout.sh +++ b/t/t7817-grep-sparse-checkout.sh @@ -49,7 +49,7 @@ test_expect_success 'setup' ' echo "text" >B/b && git add A B && git commit -m sub && - git sparse-checkout init --cone && + git sparse-checkout init --cone --no-sparse-index && git sparse-checkout set B ) &&