aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Seiki Oshiro <lucasseikioshiro@gmail.com>2026-02-25 13:32:11 -0300
committerJunio C Hamano <gitster@pobox.com>2026-02-25 11:47:42 -0800
commit3d4e6d319383d31b319227ed099a7dbd0706e165 (patch)
tree62e8f192aefed7d54ab657dd7ee0fd5465ec0f23
parentc63e64e04d43ebdc04204a052858c4801c018e1e (diff)
downloadgit-3d4e6d319383d31b319227ed099a7dbd0706e165.tar.xz
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>
-rw-r--r--builtin/repo.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/builtin/repo.c b/builtin/repo.c
index 6a62a6020a..aa9a154cd2 100644
--- a/builtin/repo.c
+++ b/builtin/repo.c
@@ -62,15 +62,15 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)
return 0;
}
-/* repo_info_fields keys must be in lexicographical order */
-static const struct field repo_info_fields[] = {
+/* repo_info_field keys must be in lexicographical order */
+static const struct field repo_info_field[] = {
{ "layout.bare", get_layout_bare },
{ "layout.shallow", get_layout_shallow },
{ "object.format", get_object_format },
{ "references.format", get_references_format },
};
-static int repo_info_fields_cmp(const void *va, const void *vb)
+static int repo_info_field_cmp(const void *va, const void *vb)
{
const struct field *a = va;
const struct field *b = vb;
@@ -81,10 +81,10 @@ static int repo_info_fields_cmp(const void *va, const void *vb)
static get_value_fn *get_value_fn_for_key(const char *key)
{
const struct field search_key = { key, NULL };
- const struct field *found = bsearch(&search_key, repo_info_fields,
- ARRAY_SIZE(repo_info_fields),
+ const struct field *found = bsearch(&search_key, repo_info_field,
+ ARRAY_SIZE(repo_info_field),
sizeof(*found),
- repo_info_fields_cmp);
+ repo_info_field_cmp);
return found ? found->get_value : NULL;
}
@@ -137,8 +137,8 @@ static int print_all_fields(struct repository *repo,
{
struct strbuf valbuf = STRBUF_INIT;
- for (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {
- const struct field *field = &repo_info_fields[i];
+ for (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {
+ const struct field *field = &repo_info_field[i];
strbuf_reset(&valbuf);
field->get_value(repo, &valbuf);
@@ -164,8 +164,8 @@ static int print_keys(enum output_format format)
die(_("--keys can only be used with --format=lines or --format=nul"));
}
- for (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {
- const struct field *field = &repo_info_fields[i];
+ for (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {
+ const struct field *field = &repo_info_field[i];
printf("%s%c", field->key, sep);
}