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>
This commit is contained in:
committed by
Junio C Hamano
parent
5bf20d6c77
commit
2e573d61ff
@@ -3220,7 +3220,9 @@ static int files_reflog_expire(struct ref_store *ref_store,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int files_init_db(struct ref_store *ref_store, struct strbuf *err UNUSED)
|
||||
static int files_init_db(struct ref_store *ref_store,
|
||||
int flags UNUSED,
|
||||
struct strbuf *err UNUSED)
|
||||
{
|
||||
struct files_ref_store *refs =
|
||||
files_downcast(ref_store, REF_STORE_WRITE, "init_db");
|
||||
|
||||
Reference in New Issue
Block a user