]> git.ipfire.org Git - thirdparty/git.git/commit
setup: don't apply "GIT_REFERENCE_BACKEND" without a repository
authorPatrick Steinhardt <ps@pks.im>
Thu, 25 Jun 2026 09:20:01 +0000 (11:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Jun 2026 15:27:19 +0000 (08:27 -0700)
commit7d9ffe68f2fc525c676a71996550bc9a4d350d11
treefbc74bdce53c07292e761e1c006e6b11c8c54da8
parent93c4361c41c3ac554ce8f61d8551d272d39ccd79
setup: don't apply "GIT_REFERENCE_BACKEND" without a repository

When discovering a repository we eventually also apply the
"GIT_REFERENCE_BACKEND" environment variable to the repository. There's
two problems with that:

  - We do this unconditionally, which is rather pointless: we really
    only have to configure the repository when we have found one.

  - We have already applied the repository format at that point in time,
    so we need to manually reapply it.

Move the logic around so that we only apply the environment variable
when a repository was discovered. This also allows us to drop the
explcit call to `repo_set_ref_storage_format()` because we now adjust
the format before we apply it via `apply_repository_format()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c