Re: [RFC] TODO in read-cache.c
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 7, 2019, 03:04 UTC
- Message-ID
- <CACsJy8DURQdR3gAB4-KDz2mbdoZcXh8-+LdmCdzjMRsPv64pQw@mail.gmail.com>
- In-Reply-To
- <CAMknYEMVdH9f-sxyRkfL8OtFjC993ooAf_8z0SGA07+86NB66g@mail.gmail.com>
On Sat, Apr 6, 2019 at 8:30 PM Kapil Jain <jkapil.cs@gmail.com> wrote:
Show 18 quoted lines
> > On Sat, Apr 6, 2019 at 5:49 PM Duy Nguyen <pclouds@gmail.com> wrote: > > > > On Sat, Apr 6, 2019 at 7:14 PM Kapil Jain <jkapil.cs@gmail.com> wrote: > > > > In some cases, it will be simple. For example, if you have a look at > > > > repo_read_index(), it already knows what repo it handles, so you can > > > > just extend read_index_from() to take 'struct repository *' and pass > > > > 'repo' to it. > > > > > > > > Be careful though, repository and istate does not have one-to-one > > > > relationship (I'll leave it to you to find out why). So you cannot > > > > replace > > > > > at a lot of place where, read_index_from() is called, the repo struct > is not available, so i am passing `the_repository` in those calls. > this makes me wonder if this is really required, because most of the > places just don't have repo.
We're still in a transition period where many places still assume the default repo (so yes don't have "repo" or "r" argument). Once everything is converted, the_repository should only appear in very few places and will be passed down as "r" argument to all functions.
-- Duy