Re: [PATCH 2/4] split-index; stop abusing the `base_oid` to strip the "link" extension
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 23, 2023, 16:06 UTC
- Message-ID
- <xmqqh6uba1vs.fsf@gitster.g>
- In-Reply-To
- <ba23850b-0fc5-4a82-49df-88550ae8b4ed@jeffhostetler.com>
Jeff Hostetler <git@jeffhostetler.com> writes:
Show 12 quoted lines
>>> +enum strip_extensions {
>>> + WRITE_ALL_EXTENSIONS = 0,
>>> + STRIP_ALL_EXTENSIONS = 1,
>>> + STRIP_LINK_EXTENSION_ONLY = 2
>>> +};
>> We do not need to spell out the specific values for this enum; the
>> users' (i.e. the callers of do_write_index()) sole requirement is
>> for these symbols to have different values.
>
> There are several calls to do_write_locked_index() that pass 0 or 1
> as the new final arg. If we update them to use these enum values,
> then we don't need integer values here.Good eyes. Yes, the new caller that selectively passes STRIP_LINK_EXTENSION_ONLY should pass WRITE_ALL_EXTENSIONS, not 0, on the other side of ?: as you pointed out.
Thanks.