aboutsummaryrefslogtreecommitdiffstats
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-01-26 08:54:46 -0800
committerJunio C Hamano <gitster@pobox.com>2024-01-26 08:54:46 -0800
commitdc8ce995a2ad203ffb5ef335682b64da955e645a (patch)
tree5fb18d234cc42148bbd37754477fded0bff1cca4 /refs.c
parentf95bafbaed2d9f9c891e04c3680c1aa0da30629e (diff)
parent8f4c00de954f809e83daf8b1425de82561f3721e (diff)
downloadgit-dc8ce995a2ad203ffb5ef335682b64da955e645a.tar.gz
Merge branch 'ps/worktree-refdb-initialization'
Instead of manually creating refs/ hierarchy on disk upon a creation of a secondary worktree, which is only usable via the files backend, use the refs API to populate it. * ps/worktree-refdb-initialization: builtin/worktree: create refdb via ref backend worktree: expose interface to look up worktree by name builtin/worktree: move setup of commondir file earlier refs/files: skip creation of "refs/{heads,tags}" for worktrees setup: move creation of "refs/" into the files backend refs: prepare `refs_init_db()` for initializing worktree refs
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/refs.c b/refs.c
index 20e8f1ff1f..c4a1a8c8c1 100644
--- a/refs.c
+++ b/refs.c
@@ -1997,11 +1997,9 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs,
}
/* backend functions */
-int refs_init_db(struct strbuf *err)
+int refs_init_db(struct ref_store *refs, int flags, struct strbuf *err)
{
- struct ref_store *refs = get_main_ref_store(the_repository);
-
- return refs->be->init_db(refs, err);
+ return refs->be->init_db(refs, flags, err);
}
const char *resolve_ref_unsafe(const char *refname, int resolve_flags,