Thread (7 messages) flat view 7 messages, 2 authors, 2021-05-17

Re: [PATCH 2/2] sparse-index.c: don't call prepare_repo_settings() twice in a row

From: Derrick Stolee <hidden>
Date: 2021-05-05 14:01:00

On 5/5/2021 8:11 AM, Ævar Arnfjörð Bjarmason wrote:
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".
I'm not sure about the value here. prepare_repo_settings() returns
quickly if the settings have already been prepared, so a second call
is negligible in cost.
quoted hunk ↗ jump to hunk
@@ -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);
The change presented here to either call set_sparse_index_config()
_or_ prepare_repo_settings() seems like it knows too much about
how set_sparse_index_config() works.

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help