Subject: Re: [PATCH v2 3/6] cocci & cache.h: apply pending "index_cache_pos" rule

From: Junio C Hamano <[email-masked]>
Date: Fri, 10 Feb 2023 11:37:18 -0800

Ævar Arnfjörð Bjarmason  <[email-masked]> writes:

> -				int dst_pos = cache_name_pos(dst, strlen(dst));
> +				int dst_pos = index_name_pos(&the_index, dst,
> +							     strlen(dst));

This is not wrong per-se, but open coding what cache_name_pos() did
does not reduce the reliance of the singleton default instance of
the in-core index data structure.

What may have more value may be passing the pointer to an in-core
index structure through the codebase, which may help more parts to
be made callable as if they were library functions, but that would
be a much larger task and won't belong to this "finish the
conversion" topic.  But doing this change will not help us to get
closer to such a longer term clean-up, I am afraid.

Will queue.