aboutsummaryrefslogtreecommitdiffstats
path: root/refs.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-01-08 11:05:26 +0100
committerJunio C Hamano <gitster@pobox.com>2024-01-08 13:17:30 -0800
commit2e573d61ffe3d1e7ea94673757fb69477c1499bc (patch)
tree7710c1b5c414633ef1984f0cac1b2313d3c3b164 /refs.c
parentMerge branch 'ps/refstorage-extension' into ps/worktree-refdb-initialization (diff)
downloadgit-2e573d61ffe3d1e7ea94673757fb69477c1499bc.tar.gz
git-2e573d61ffe3d1e7ea94673757fb69477c1499bc.zip
refs: prepare `refs_init_db()` for initializing worktree refs
The purpose of `refs_init_db()` is to initialize the on-disk files of a new ref database. The function is quite inflexible right now though, as callers can neither specify the `struct ref_store` nor can they pass any flags. Refactor the interface to accept both of these. This will be required so that we can start initializing per-worktree ref databases via the ref backend instead of open-coding the initialization in "worktree.c". Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 fdbf5f4cb1..254272ba6f 100644
--- a/refs.c
+++ b/refs.c
@@ -1944,11 +1944,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,