From: Junio C Hamano Date: Wed, 10 Jun 2026 17:32:46 GMT Subject: Re: [PATCH 3/9] setup: don't apply "GIT_REFERENCE_BACKEND" without a repository Message-ID: In-Reply-To: <20260610-b4-pks-refs-avoid-chdir-notify-reparent-v1-3-56c864b01c43@pks.im> Patrick Steinhardt writes: > 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. Does the second point have a small typo, i.e., "if we have a repository, we have already applied the ref backend to it when we discovered it, so NO need to manually reapply"? > 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()`. Makes sense.