Re: [PATCH v4 03/12] replay: stop using `the_repository`
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Oct 14, 2025, 08:53 UTC
- Message-ID
- <CAOLa=ZQQXEjTPLOwdsPKd2U1xzq1MwjGDeDdCAbv_eg4NK-TNA@mail.gmail.com>
- In-Reply-To
- <20251001-b4-pks-history-builtin-v4-3-8e61ddb86317@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> In `create_commit()` we're using `the_repository` even though we already > have a repository passed to use as an argument. Fix this. >
I was thinking about this as I read your previous patch. This makes sense.
Show 5 quoted lines
> Note that we still cannot get rid of `USE_THE_REPOSITORY_VARIABLE`. This > is because we use `DEFAULT_ABBREV and `get_commit_output_encoding()`, > both of which are stored as global variables that can be modified via > the Git configuration. >
That's a bummer. But one less step needed is a win.
Show 21 quoted lines
> Signed-off-by: Patrick Steinhardt <ps@pks.im> > --- > replay.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/replay.c b/replay.c > index e22ce39940..13d75d8054 100644 > --- a/replay.c > +++ b/replay.c > @@ -62,7 +62,7 @@ static struct commit *create_commit(struct repository *repo, > obj = parse_object(repo, &ret); > > out: > - repo_unuse_commit_buffer(the_repository, based_on, message); > + repo_unuse_commit_buffer(repo, based_on, message); > free_commit_extra_headers(extra); > free_commit_list(parents); > strbuf_release(&msg); > > -- > 2.51.0.700.g236ee7b076.dirty