[PATCH 11/13] setup: drop redundant configuration of `startup_info->have_repository`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 30, 2026, 11:47 UTC
- Message-ID
- <20260630-pks-setup-split-discovery-and-setup-v1-11-13864eb5a032@pks.im>
- In-Reply-To
- <20260630-pks-setup-split-discovery-and-setup-v1-0-13864eb5a032@pks.im>
In `init_db()` we set `startup_info->have_repository` twice: once before reading and applying the repository format and once after. This is redundant though, as configuring the repository format does not rely on this variable at all.
Remove the first such site. While at it, fix up formatting a bit.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- setup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/setup.c b/setup.c index 7715f3ea85..4f37a7b642 100644 --- a/setup.c +++ b/setup.c @@ -2847,12 +2847,10 @@ int init_db(struct repository *repo, apply_and_export_relative_gitdir(repo, real_git_dir, 1); git_dir = repo_get_git_dir(repo); separate_git_dir(git_dir, original_git_dir); - } - else { + } else { apply_and_export_relative_gitdir(repo, git_dir, 1); git_dir = repo_get_git_dir(repo); } - startup_info->have_repository = 1; /* * Check to see if the repository version is right.
-- 2.55.0.795.g602f6c329a.dirty