Re: [PATCH 10/35] commit: add repository argument to lookup_commit
- From
Stefan Beller <sbeller@google.com>
- Date
- Jun 14, 2018, 21:15 UTC
- Message-ID
- <CAGZ79kapzeBc1KJFCS2Q4UsZDssaFpf6xamva68LAp+gQcTCCw@mail.gmail.com>
- In-Reply-To
- <CACsJy8D2JbeWvBg9F69tAJgq1874=ROFBG-QKfCHeUMZwcY-VQ@mail.gmail.com>
On Thu, Jun 14, 2018 at 9:22 AM Duy Nguyen <pclouds@gmail.com> wrote:
Show 15 quoted lines
>
> On Wed, May 30, 2018 at 2:51 AM Stefan Beller <sbeller@google.com> wrote:
> > diff --git a/shallow.c b/shallow.c
> > index 9bb07a56dca..60fe1fe1e58 100644
> > --- a/shallow.c
> > +++ b/shallow.c
> > @@ -31,7 +31,7 @@ int register_shallow(struct repository *r, const struct object_id *oid)
> > {
> > struct commit_graft *graft =
> > xmalloc(sizeof(struct commit_graft));
> > - struct commit *commit = lookup_commit(oid);
> > + struct commit *commit = lookup_commit(the_repository, oid);
>
> This looks wrong. register_shallow() has struct repository argument
> 'r' and it should be used here instead.Right.
> If this is a mechanical conversion, I will also be happy that the > switch from the_repo to r is done in a separate patch.
This part of the code is not touched later in this series, so I'll fix it if a reroll is needed.
Show 9 quoted lines
> FYI I noticed this because I'm in a quest to kill the_index by passing > 'struct index_state *' throughout library code, and sometimes I pass > 'struct repository *' instead when I see that code uses more things > that just the index. And I have started to replace the_repository in > some places with a function argument. > > If some of my patches come first while you have not finished > repository conversion (very likely), you and I will have to pay > attention to this more often.