refs: rename init_db callback to avoid confusion

Reference backends have two callbacks `init` and `init_db`. The
similarity of these two callbacks has repeatedly confused me whenever I
was looking at them, where I always had to look up which of them does
what.

Rename the `init_db` callback to `create_on_disk`, which should
hopefully be clearer.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-05-17 10:18:19 +02:00
committed by Junio C Hamano
parent 1febabff7a
commit ed93ea1602
9 changed files with 29 additions and 29 deletions

View File

@ -293,12 +293,12 @@ done:
return &refs->base;
}
static int reftable_be_init_db(struct ref_store *ref_store,
int flags UNUSED,
struct strbuf *err UNUSED)
static int reftable_be_create_on_disk(struct ref_store *ref_store,
int flags UNUSED,
struct strbuf *err UNUSED)
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_WRITE, "init_db");
reftable_be_downcast(ref_store, REF_STORE_WRITE, "create");
struct strbuf sb = STRBUF_INIT;
strbuf_addf(&sb, "%s/reftable", refs->base.gitdir);
@ -2248,7 +2248,7 @@ done:
struct ref_storage_be refs_be_reftable = {
.name = "reftable",
.init = reftable_be_init,
.init_db = reftable_be_init_db,
.create_on_disk = reftable_be_create_on_disk,
.transaction_prepare = reftable_be_transaction_prepare,
.transaction_finish = reftable_be_transaction_finish,
.transaction_abort = reftable_be_transaction_abort,