From: Chinmoy Chakraborty Date: Thu, 08 Apr 2021 03:56:12 GMT Subject: Re: [PATCH v4] cache-tree.c: remove implicit dependency on the_repository Message-ID: <0df415b7-73b7-6e72-1885-3ca606acf8fd@gmail.com> In-Reply-To: On 4/8/21 4:33 AM, Junio C Hamano wrote: > "Chinmoy via GitGitGadget" writes: > >> From: Chinmoy Chakraborty >> >> This kills the_repository dependency in cache_tree_update() >> and prime_cache_tree(). >> >> Signed-off-by: Chinmoy Chakraborty >> --- >> Replace the_repository with r > Huh??? Sorry I forgot to change the cover letter. > 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?