Thread (10 messages) flat view 10 messages, 4 authors, 2021-04-08

Re: [PATCH v4] cache-tree.c: remove implicit dependency on the_repository

From: Chinmoy Chakraborty <hidden>
Date: 2021-04-08 03:54:50

On 4/8/21 4:33 AM, Junio C Hamano wrote:
"Chinmoy via GitGitGadget" [off-list ref] writes:
quoted
From: Chinmoy Chakraborty <redacted>

This kills the_repository dependency in cache_tree_update()
and prime_cache_tree().

Signed-off-by: Chinmoy Chakraborty <redacted>
---
     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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help