Change code added in 58300f47432 (sparse-index: add index.sparse config option, 2021-03-30) to only call prepare_repo_settings() once. We know that our own set_sparse_index_config() has just finished calling it, so we don't need to call it if we're acting on "test_env". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> --- sparse-index.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sparse-index.c b/sparse-index.c index b0d5dc5f081..5bad05de645 100644 --- a/sparse-index.c +++ b/sparse-index.c @@ -133,11 +133,12 @@ int convert_to_sparse(struct index_state *istate) test_env = git_env_bool("GIT_TEST_SPARSE_INDEX", -1); if (test_env >= 0) set_sparse_index_config(istate->repo, test_env); + else + prepare_repo_settings(istate->repo); /* * Only convert to sparse if index.sparse is set. */ - prepare_repo_settings(istate->repo); if (!istate->repo->settings.sparse_index) return 0; -- 2.31.1.838.g7ac6e98bb53