Re: [PATCH v3 2/2] repo: add --all to git-repo-info
On Sun, Oct 26, 2025 at 8:22 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 13 quoted lines
> On Sun, Oct 26, 2025 at 6:54 PM Lucas Seiki Oshiro
> <lucasseikioshiro@gmail.com> wrote:
> > + for (unsigned long i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {
> > + struct field field = repo_info_fields[i];
>
> Why do we need to make a copy of the field record? Can't we just use a
> const pointer?
>
> struct field *field = &repo_info_fields[i];
>
> or:
>
> struct field *field = repo_info_fields + i;Of course, I mean to have a `const` in there:
const struct field *field = &repo_info_fields[i];