]> git.ipfire.org Git - thirdparty/git.git/commitdiff
setup: drop redundant configuration of `startup_info->have_repository`
authorPatrick Steinhardt <ps@pks.im>
Tue, 7 Jul 2026 07:21:30 +0000 (09:21 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Jul 2026 17:49:41 +0000 (10:49 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c

diff --git a/setup.c b/setup.c
index d4de8c2900630f43ca9336179d158c3c8da96ca8..088e7b85f7a503735bad88dd3309a13f4b3b480c 100644 (file)
--- 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.