Skip to content

Commit 1a36c41

Browse files
derrickstoleedscho
authored andcommitted
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 <dstolee@microsoft.com>
1 parent 0c1a6b0 commit 1a36c41

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

repo-settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void prepare_repo_settings(struct repository *r)
7474
repo_cfg_bool(r, "fetch.writecommitgraph", &r->settings.fetch_write_commit_graph, 0);
7575
repo_cfg_bool(r, "pack.usesparse", &r->settings.pack_use_sparse, 1);
7676
repo_cfg_bool(r, "core.multipackindex", &r->settings.core_multi_pack_index, 1);
77-
repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 0);
77+
repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 1);
7878

7979
/*
8080
* The GIT_TEST_MULTI_PACK_INDEX variable is special in that

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ init_repos () {
155155
git -C sparse-index reset --hard &&
156156

157157
# initialize sparse-checkout definitions
158+
git -C sparse-checkout config index.sparse false &&
158159
git -C sparse-checkout sparse-checkout init --cone &&
159160
git -C sparse-checkout sparse-checkout set deep &&
160161
git -C sparse-index sparse-checkout init --cone --sparse-index &&

t/t7817-grep-sparse-checkout.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test_expect_success 'setup' '
4949
echo "text" >B/b &&
5050
git add A B &&
5151
git commit -m sub &&
52-
git sparse-checkout init --cone &&
52+
git sparse-checkout init --cone --no-sparse-index &&
5353
git sparse-checkout set B
5454
) &&
5555

0 commit comments

Comments
 (0)