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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 4/8/21 4:33 AM, Junio C Hamano wrote:
"Chinmoy via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

From: Chinmoy Chakraborty <chinmoy12c@xxxxxxxxx>

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

Signed-off-by: Chinmoy Chakraborty <chinmoy12c@xxxxxxxxx>
---
     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?




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux