]> 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>
Thu, 25 Jun 2026 20:19:57 +0000 (13:19 -0700)
commit0248cd1e7228bc88a2580e2dd27e79ee66ae5d53
treefbc74bdce53c07292e761e1c006e6b11c8c54da8
parent5e5d57e1f892cea0db568e90bd6a0f03490dd021
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