Skip to content

Commit f453ac3

Browse files
lucasoshirogitster
authored andcommitted
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>
1 parent fdcdab3 commit f453ac3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

builtin/repo.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)
6262
return 0;
6363
}
6464

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[] = {
6767
{ "layout.bare", get_layout_bare },
6868
{ "layout.shallow", get_layout_shallow },
6969
{ "object.format", get_object_format },
7070
{ "references.format", get_references_format },
7171
};
7272

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)
7474
{
7575
const struct field *a = va;
7676
const struct field *b = vb;
@@ -81,10 +81,10 @@ static int repo_info_fields_cmp(const void *va, const void *vb)
8181
static get_value_fn *get_value_fn_for_key(const char *key)
8282
{
8383
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),
8686
sizeof(*found),
87-
repo_info_fields_cmp);
87+
repo_info_field_cmp);
8888
return found ? found->get_value : NULL;
8989
}
9090

@@ -137,8 +137,8 @@ static int print_all_fields(struct repository *repo,
137137
{
138138
struct strbuf valbuf = STRBUF_INIT;
139139

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];
142142

143143
strbuf_reset(&valbuf);
144144
field->get_value(repo, &valbuf);
@@ -164,8 +164,8 @@ static int print_keys(enum output_format format)
164164
die(_("--keys can only be used with --format=lines or --format=nul"));
165165
}
166166

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];
169169
printf("%s%c", field->key, sep);
170170
}
171171

0 commit comments

Comments
 (0)