From: Eric Sunshine Date: Fri, 29 Dec 2023 10:35:49 GMT Subject: Re: [PATCH 3/6] refs/files: skip creation of "refs/{heads,tags}" for worktrees Message-ID: In-Reply-To: <3cf6ceb274d20ce76d0be65e4362a33579627052.1703754513.git.ps@pks.im> On Fri, Dec 29, 2023 at 5:16 AM Patrick Steinhardt wrote: > The files ref backend will create both "refs/heads" and "refs/tags" in > the Git directory. While this logic makes sense for normal repositories, > it does not fo worktrees because those refs are "common" refs that would > always be contained in the main repository's ref database. s/fo/for/ (not worth a reroll) > Introduce a new flag telling the backend that it is expected to create a > per-worktree ref database and skip creation of these dirs in the files > backend when the flag is set. No other backends (currently) need > worktree-specific logic, so this is the only required change to start > creating per-worktree ref databases via `refs_init_db()`. > > Signed-off-by: Patrick Steinhardt