Re: [PATCH v3 2/7] invalidate_ref_cache(): take the submodule as parameter
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 17, 2011, 18:00 UTC
- Message-ID
- <7vmxczmrb0.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4E960F91.5020103@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 18 quoted lines
> On 10/12/2011 09:19 PM, Junio C Hamano wrote:
>> Michael Haggerty <mhagger@alum.mit.edu> writes:
>> ...
>> Probably that is what all the existing callers want, but I would have
>> expected that an existing feature would be kept, perhaps like this
>> instead:
>>
>> if (!submodule) {
>> struct ref_cache *c;
>> for (c = ref_cache; c; c = c->next)
>> clear_ref_cache(c);
>> } else {
>> clear_ref_cache(get_ref_cache(submodule);
>> }
> ...
> Your specific suggestion would not work because currently
> submodule==NULL signifies the main module. However, it would be easy to
> add the few-line function when/if it is needed.I think "submodule==NULL" is probably a mistake; "" would make more sense given that you are storing the string in name[FLEX_ARRAY] field.