Re: [PATCH 10/35] commit: add repository argument to lookup_commit
From: Stefan Beller <hidden>
Date: 2018-06-14 21:16:49
On Thu, Jun 14, 2018 at 9:22 AM Duy Nguyen [off-list ref] wrote:
On Wed, May 30, 2018 at 2:51 AM Stefan Beller [off-list ref] wrote:quoted
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.
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.