aboutsummaryrefslogtreecommitdiff
path: root/refs/reftable-backend.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-17 10:18:19 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-17 10:33:36 -0700
commited93ea16025decb60eb91308d682884e263e6f85 (patch)
treeed27ff45724032a288d82cbd745bd128a4f8bd87 /refs/reftable-backend.c
parent1febabff7a3945537b5cd7ec0ad4a4e8b2ba9001 (diff)
downloadgit-ed93ea16025decb60eb91308d682884e263e6f85.tar.xz
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>
Diffstat (limited to 'refs/reftable-backend.c')
-rw-r--r--refs/reftable-backend.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
index 010ef811b6..8583a0cdba 100644
--- a/refs/reftable-backend.c
+++ b/refs/reftable-backend.c
@@ -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,