summaryrefslogtreecommitdiff
path: root/refs/files-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/files-backend.c
parent1febabff7a3945537b5cd7ec0ad4a4e8b2ba9001 (diff)
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/files-backend.c')
-rw-r--r--refs/files-backend.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2c9d5e0747..f9f15d1f76 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3236,12 +3236,12 @@ static int files_reflog_expire(struct ref_store *ref_store,
return -1;
}
-static int files_init_db(struct ref_store *ref_store,
- int flags,
- struct strbuf *err UNUSED)
+static int files_ref_store_create_on_disk(struct ref_store *ref_store,
+ int flags,
+ struct strbuf *err UNUSED)
{
struct files_ref_store *refs =
- files_downcast(ref_store, REF_STORE_WRITE, "init_db");
+ files_downcast(ref_store, REF_STORE_WRITE, "create");
struct strbuf sb = STRBUF_INIT;
/*
@@ -3264,7 +3264,7 @@ static int files_init_db(struct ref_store *ref_store,
* There is no need to create directories for common refs when creating
* a worktree ref store.
*/
- if (!(flags & REFS_INIT_DB_IS_WORKTREE)) {
+ if (!(flags & REF_STORE_CREATE_ON_DISK_IS_WORKTREE)) {
/*
* Create .git/refs/{heads,tags}
*/
@@ -3284,7 +3284,7 @@ static int files_init_db(struct ref_store *ref_store,
struct ref_storage_be refs_be_files = {
.name = "files",
.init = files_ref_store_init,
- .init_db = files_init_db,
+ .create_on_disk = files_ref_store_create_on_disk,
.transaction_prepare = files_transaction_prepare,
.transaction_finish = files_transaction_finish,
.transaction_abort = files_transaction_abort,