All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Derrick Stolee" <stolee@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/2] sparse-index.c: don't call prepare_repo_settings() twice in a row
Date: Wed,  5 May 2021 14:11:59 +0200	[thread overview]
Message-ID: <patch-2.2-8bca02efcee-20210505T121028Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.2-00000000000-20210505T121028Z-avarab@gmail.com>

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@gmail.com>
---
 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


  parent reply	other threads:[~2021-05-05 12:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 12:11 [PATCH 0/2] sparse-index.c: minor prepare_repo_settings() fixes Ævar Arnfjörð Bjarmason
2021-05-05 12:11 ` [PATCH 1/2] sparse-index.c: remove set_index_sparse_config() Ævar Arnfjörð Bjarmason
2021-05-05 14:01   ` Derrick Stolee
2021-05-05 12:11 ` Ævar Arnfjörð Bjarmason [this message]
2021-05-05 14:00   ` [PATCH 2/2] sparse-index.c: don't call prepare_repo_settings() twice in a row Derrick Stolee
2021-05-06  3:55     ` Junio C Hamano
2021-05-06  8:49     ` Ævar Arnfjörð Bjarmason
2021-05-17 17:31       ` Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-2.2-8bca02efcee-20210505T121028Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.