repo: rename repo_info_fields to repo_info_field
Rename repo_info_fields as repo_info_field, following the CodingGuidelines rule for naming arrays in singular. Rename all the references to that array accordingly. Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lucas Seiki Oshiro committed
Feb 25, 2026 at 13:32 UTC
3d4e6d319383d31b319227ed099a7dbd0706e165
1 file changed
+10
-10
builtin/repo.c
+10
-10
@@ -62,15 +62,15 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)
62
return 0;
63
}
64
65
-/* repo_info_fields keys must be in lexicographical order */
66
-static const struct field repo_info_fields[] = {
65
+/* repo_info_field keys must be in lexicographical order */
66
+static const struct field repo_info_field[] = {
67
{ "layout.bare", get_layout_bare },
68
{ "layout.shallow", get_layout_shallow },
69
{ "object.format", get_object_format },
70
{ "references.format", get_references_format },
71
};
72
73
-static int repo_info_fields_cmp(const void *va, const void *vb)
73
+static int repo_info_field_cmp(const void *va, const void *vb)
74
{
75
const struct field *a = va;
76
const struct field *b = vb;
@@ -81,10 +81,10 @@ static int repo_info_fields_cmp(const void *va, const void *vb)
81
static get_value_fn *get_value_fn_for_key(const char *key)
82
{
83
const struct field search_key = { key, NULL };
84
- const struct field *found = bsearch(&search_key, repo_info_fields,
85
- ARRAY_SIZE(repo_info_fields),
84
+ const struct field *found = bsearch(&search_key, repo_info_field,
85
+ ARRAY_SIZE(repo_info_field),
86
sizeof(*found),
87
- repo_info_fields_cmp);
87
+ repo_info_field_cmp);
88
return found ? found->get_value : NULL;
89
}
90
@@ -137,8 +137,8 @@ static int print_all_fields(struct repository *repo,
137
{
138
struct strbuf valbuf = STRBUF_INIT;
139
140
- for (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {
141
- const struct field *field = &repo_info_fields[i];
140
+ for (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {
141
+ const struct field *field = &repo_info_field[i];
142
143
strbuf_reset(&valbuf);
144
field->get_value(repo, &valbuf);
@@ -164,8 +164,8 @@ static int print_keys(enum output_format format)
164
die(_("--keys can only be used with --format=lines or --format=nul"));
165
}
166
167
- for (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {
168
- const struct field *field = &repo_info_fields[i];
167
+ for (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {
168
+ const struct field *field = &repo_info_field[i];
169
printf("%s%c", field->key, sep);
170
}
171