diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-01-08 11:05:35 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-01-08 22:17:30 +0100 |
commit | 2eb1d0c45271faf149a13b61bb74af52abd7b3aa (patch) | |
tree | d1e19a1d3f8066a0e0ae0f6ba66a91d1ff062444 /refs.h | |
parent | setup: move creation of "refs/" into the files backend (diff) | |
download | git-2eb1d0c45271faf149a13b61bb74af52abd7b3aa.tar.xz git-2eb1d0c45271faf149a13b61bb74af52abd7b3aa.zip |
refs/files: skip creation of "refs/{heads,tags}" for worktrees
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 for worktrees because those refs are "common" refs that
would always be contained in the main repository's ref database.
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -126,6 +126,8 @@ int should_autocreate_reflog(const char *refname); int is_branch(const char *refname); +#define REFS_INIT_DB_IS_WORKTREE (1 << 0) + int refs_init_db(struct ref_store *refs, int flags, struct strbuf *err); /* |