Re: [PATCH v2 09/12] attr: (re)introduce git_check_attr() and struct git_attr_check
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 17, 2016, 05:06 UTC
- Message-ID
- <xmqqr3d1xoho.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAPig+cR5ksdATefkYkG7-+a_nK0w+Fdu8ae-Z4=PTp8yAYhiQQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
> This field is unused, and git_attr_check_initl() neglects to > initialize it (if it is intended to be used in the future).
There are two patterns to use the new API:
- initl() variant is "initialize it once, never extend"; it is very much deliberate. This is used by the majority of current callers, that know that they want a fixed set of attributes and can say what attributes they want upfront.
- alloc then append variant will use the usual ALLOC_GROW() pattern with nr/alloc.