summaryrefslogtreecommitdiff
path: root/refs/files-backend.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-17 17:27:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-17 17:36:04 (GMT)
commit32bff617c6aff52d6d147c8b4e93efc7f06fa388 (patch)
treeaa80bd931ae3f1f3b9b57a467927fbca28e06fef /refs/files-backend.c
parent74cc1aa55f30ed76424a0e7226ab519aa6265061 (diff)
downloadgit-32bff617c6aff52d6d147c8b4e93efc7f06fa388.zip
git-32bff617c6aff52d6d147c8b4e93efc7f06fa388.tar.gz
git-32bff617c6aff52d6d147c8b4e93efc7f06fa388.tar.bz2
refs: use designated initializers for "struct ref_storage_be"
Change the definition of the three refs backends we currently carry to use designated initializers. The "= NULL" assignments being retained here are redundant, and could be removed, but let's keep them for clarity. All of these backends define almost all fields, so we're not saving much in terms of line count by omitting these, but e.g. for "refs_be_debug" it's immediately apparent that we're omitting "init" when comparing its assignment to the others. This is a follow-up to similar work merged in bd4232fac33 (Merge branch 'ab/struct-init', 2021-07-16), a4b9fb6a5cf (Merge branch 'ab/designated-initializers-more', 2021-10-18) and a30321b9eae (Merge branch 'ab/designated-initializers' into ab/designated-initializers-more, 2021-09-27). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
-rw-r--r--refs/files-backend.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 0457ecd..f95552f 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3291,30 +3291,30 @@ static int files_init_db(struct ref_store *ref_store, struct strbuf *err)
}
struct ref_storage_be refs_be_files = {
- NULL,
- "files",
- files_ref_store_create,
- files_init_db,
- files_transaction_prepare,
- files_transaction_finish,
- files_transaction_abort,
- files_initial_transaction_commit,
-
- files_pack_refs,
- files_create_symref,
- files_delete_refs,
- files_rename_ref,
- files_copy_ref,
-
- files_ref_iterator_begin,
- files_read_raw_ref,
- files_read_symbolic_ref,
-
- files_reflog_iterator_begin,
- files_for_each_reflog_ent,
- files_for_each_reflog_ent_reverse,
- files_reflog_exists,
- files_create_reflog,
- files_delete_reflog,
- files_reflog_expire
+ .next = NULL,
+ .name = "files",
+ .init = files_ref_store_create,
+ .init_db = files_init_db,
+ .transaction_prepare = files_transaction_prepare,
+ .transaction_finish = files_transaction_finish,
+ .transaction_abort = files_transaction_abort,
+ .initial_transaction_commit = files_initial_transaction_commit,
+
+ .pack_refs = files_pack_refs,
+ .create_symref = files_create_symref,
+ .delete_refs = files_delete_refs,
+ .rename_ref = files_rename_ref,
+ .copy_ref = files_copy_ref,
+
+ .iterator_begin = files_ref_iterator_begin,
+ .read_raw_ref = files_read_raw_ref,
+ .read_symbolic_ref = files_read_symbolic_ref,
+
+ .reflog_iterator_begin = files_reflog_iterator_begin,
+ .for_each_reflog_ent = files_for_each_reflog_ent,
+ .for_each_reflog_ent_reverse = files_for_each_reflog_ent_reverse,
+ .reflog_exists = files_reflog_exists,
+ .create_reflog = files_create_reflog,
+ .delete_reflog = files_delete_reflog,
+ .reflog_expire = files_reflog_expire
};