Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions repo-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ void prepare_repo_settings(struct repository *r)
r->settings.command_requires_full_index = 1;

/*
* Initialize this as off.
* Initialize this as on.
*/
r->settings.sparse_index = 0;
if (!repo_config_get_bool(r, "index.sparse", &value) && value)
r->settings.sparse_index = 1;
r->settings.sparse_index = 1;
if (!repo_config_get_bool(r, "index.sparse", &value) && !value)
r->settings.sparse_index = 0;
}
2 changes: 1 addition & 1 deletion sparse-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int set_sparse_index_config(struct repository *repo, int enable)
char *config_path = repo_git_path(repo, "config.worktree");
res = git_config_set_in_file_gently(config_path,
"index.sparse",
enable ? "true" : NULL);
enable ? "true" : "false");
free(config_path);

prepare_repo_settings(repo);
Expand Down
2 changes: 1 addition & 1 deletion t/t1091-sparse-checkout-builtin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ test_expect_success 'sparse-index enabled and disabled' '
test-tool -C repo read-cache --table >cache &&
! grep " tree " cache &&
git -C repo config --list >config &&
! grep index.sparse config
test_cmp_config -C repo false index.sparse
'

test_expect_success 'cone mode: init and set' '
Expand Down
1 change: 1 addition & 0 deletions t/t1092-sparse-checkout-compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,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 &&
Expand Down
2 changes: 1 addition & 1 deletion t/t7817-grep-sparse-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
) &&

Expand Down