Skip to content

Commit 1febabf

Browse files
pks-tgitster
authored andcommitted
refs: adjust names for init and init_db callbacks
The names of the functions that implement the `init` and `init_db` callbacks in the "files" and "packed" backends do not match the names of the callbacks, which is inconsistent. Rename them so that they match, which makes it easier to discover their respective implementations. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4653627 commit 1febabf

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

refs/files-backend.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ static void clear_loose_ref_cache(struct files_ref_store *refs)
8989
* Create a new submodule ref cache and add it to the internal
9090
* set of caches.
9191
*/
92-
static struct ref_store *files_ref_store_create(struct repository *repo,
93-
const char *gitdir,
94-
unsigned int flags)
92+
static struct ref_store *files_ref_store_init(struct repository *repo,
93+
const char *gitdir,
94+
unsigned int flags)
9595
{
9696
struct files_ref_store *refs = xcalloc(1, sizeof(*refs));
9797
struct ref_store *ref_store = (struct ref_store *)refs;
@@ -102,7 +102,7 @@ static struct ref_store *files_ref_store_create(struct repository *repo,
102102
get_common_dir_noenv(&sb, gitdir);
103103
refs->gitcommondir = strbuf_detach(&sb, NULL);
104104
refs->packed_ref_store =
105-
packed_ref_store_create(repo, refs->gitcommondir, flags);
105+
packed_ref_store_init(repo, refs->gitcommondir, flags);
106106

107107
chdir_notify_reparent("files-backend $GIT_DIR", &refs->base.gitdir);
108108
chdir_notify_reparent("files-backend $GIT_COMMONDIR",
@@ -3283,7 +3283,7 @@ static int files_init_db(struct ref_store *ref_store,
32833283

32843284
struct ref_storage_be refs_be_files = {
32853285
.name = "files",
3286-
.init = files_ref_store_create,
3286+
.init = files_ref_store_init,
32873287
.init_db = files_init_db,
32883288
.transaction_prepare = files_transaction_prepare,
32893289
.transaction_finish = files_transaction_finish,

refs/packed-backend.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ static int release_snapshot(struct snapshot *snapshot)
200200
}
201201
}
202202

203-
struct ref_store *packed_ref_store_create(struct repository *repo,
204-
const char *gitdir,
205-
unsigned int store_flags)
203+
struct ref_store *packed_ref_store_init(struct repository *repo,
204+
const char *gitdir,
205+
unsigned int store_flags)
206206
{
207207
struct packed_ref_store *refs = xcalloc(1, sizeof(*refs));
208208
struct ref_store *ref_store = (struct ref_store *)refs;
@@ -1244,9 +1244,9 @@ int packed_refs_is_locked(struct ref_store *ref_store)
12441244
static const char PACKED_REFS_HEADER[] =
12451245
"# pack-refs with: peeled fully-peeled sorted \n";
12461246

1247-
static int packed_init_db(struct ref_store *ref_store UNUSED,
1248-
int flags UNUSED,
1249-
struct strbuf *err UNUSED)
1247+
static int packed_ref_store_init_db(struct ref_store *ref_store UNUSED,
1248+
int flags UNUSED,
1249+
struct strbuf *err UNUSED)
12501250
{
12511251
/* Nothing to do. */
12521252
return 0;
@@ -1706,8 +1706,8 @@ static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *ref_s
17061706

17071707
struct ref_storage_be refs_be_packed = {
17081708
.name = "packed",
1709-
.init = packed_ref_store_create,
1710-
.init_db = packed_init_db,
1709+
.init = packed_ref_store_init,
1710+
.init_db = packed_ref_store_init_db,
17111711
.transaction_prepare = packed_transaction_prepare,
17121712
.transaction_finish = packed_transaction_finish,
17131713
.transaction_abort = packed_transaction_abort,

refs/packed-backend.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ struct ref_transaction;
1313
* even among packed refs.
1414
*/
1515

16-
struct ref_store *packed_ref_store_create(struct repository *repo,
17-
const char *gitdir,
18-
unsigned int store_flags);
16+
struct ref_store *packed_ref_store_init(struct repository *repo,
17+
const char *gitdir,
18+
unsigned int store_flags);
1919

2020
/*
2121
* Lock the packed-refs file for writing. Flags is passed to

0 commit comments

Comments
 (0)