Re: [PATCH v4] cache-tree.c: remove implicit dependency on the_repository
On 4/8/21 4:33 AM, Junio C Hamano wrote:
Show 11 quoted lines
> "Chinmoy via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Chinmoy Chakraborty <chinmoy12c@gmail.com>
>>
>> This kills the_repository dependency in cache_tree_update()
>> and prime_cache_tree().
>>
>> Signed-off-by: Chinmoy Chakraborty <chinmoy12c@gmail.com>
>> ---
>> Replace the_repository with r
> Huh???
Sorry I forgot to change the cover letter.
Show 6 quoted lines
> The patch assumes that istate->repo will always set, but it does not
> even try to justify why that assumption is safe to make (e.g. "the
> entire codebase that leads to this function has been audited and
> made sure istate at this point will always have its .repo member is
> set" in the log message, if such an audit has actually been done,
> may have been convincing), which I find quite troubling.
Is it safe to make this assumption? I mean to be completely
sure of this, one would have to track back to all the callers.
Should a check like:
if(!istate->repo)
istate->repo = the_repository;
be required?