Re: [PATCH v2 1/4] promisor-remote: read partialClone config here
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Jun 10, 2021, 17:25 UTC
- Message-ID
- <20210610172548.356847-1-jonathantanmy@google.com>
- In-Reply-To
- <CABPp-BHt3db__cMpTY1a7y4u064NdVZGNCmnoR25aqhrWMfJcg@mail.gmail.com>
Show 16 quoted lines
> > Hmm...is your concern about the case in which > > repository_format_partial_clone is uninitialized, or about ignoring a > > potential NULL value? If the former, I don't see how your suggestion > > fixes things, since extensions.partialclone may never have been in the > > config in the first place (and would thus leave > > repository_format_partial_clone uninitialized, if it weren't for the > > fact that it is in static storage and thus initialized to 0). If the > > latter, I guess I should be more detailed about how it's being handled > > in setup.c (or maybe just leave out the comment altogether - the code > > here can handle a NULL repository_format_partial_clone for some reason). > > My comment was about the latter; I was trying to understand what the > comment meant relative to that case, and how and where that case would > be handled in the code. With that frame of reference, the comment > seemed misleading to me...though perhaps the comment was intended to > answer some other question entirely.
Junio suggested [1] that repository_format_partial_clone be handled when the repo format is validated, so this part of the code can just make use of the repository_format_partial_clone value in struct repository and not read the config itself. So I believe that this part is now obsolete (but you can take a look at patches 1 and 2 to verify, if you want).
[1] https://lore.kernel.org/git/xmqqeedbidvy.fsf@gitster.g/