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

4
refs.h
View File

@ -114,9 +114,9 @@ int should_autocreate_reflog(const char *refname);
int is_branch(const char *refname);
#define REFS_INIT_DB_IS_WORKTREE (1 << 0)
#define REF_STORE_CREATE_ON_DISK_IS_WORKTREE (1 << 0)
int refs_init_db(struct ref_store *refs, int flags, struct strbuf *err);
int ref_store_create_on_disk(struct ref_store *refs, int flags, struct strbuf *err);
/*
* Return the peeled value of the oid currently being iterated via