Re: [PATCH 2/4] sequencer: do not translate parameters to error_resolve_conflict()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 19, 2022, 09:26 UTC
- Message-ID
- <06s6r3s7-27nn-1o9s-1n7p-5413284r8740@tzk.qr>
- In-Reply-To
- <220818.86v8qp8uid.gmgdl@evledraar.gmail.com>
Hi Ævar,
On Thu, 18 Aug 2022, Ævar Arnfjörð Bjarmason wrote:
Show 35 quoted lines
> On Thu, Aug 18 2022, Michael J Gruber wrote:
>
> > `error_resolve_conflict()` checks the untranslated action_name
> > parameter, so pass it as is.
> >
> > Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> > Signed-off-by: Michael J Gruber <git@grubix.eu>
> > ---
> > sequencer.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/sequencer.c b/sequencer.c
> > index 51d75dfbe1..8b32b239b9 100644
> > --- a/sequencer.c
> > +++ b/sequencer.c
> > @@ -537,7 +537,7 @@ static struct tree *empty_tree(struct repository *r)
> > static int error_dirty_index(struct repository *repo, struct replay_opts *opts)
> > {
> > if (repo_read_index_unmerged(repo))
> > - return error_resolve_conflict(_(action_name(opts)));
> > + return error_resolve_conflict(action_name(opts));
> >
> > error(_("your local changes would be overwritten by %s."),
> > _(action_name(opts)));
> > @@ -3753,7 +3753,7 @@ static int do_reset(struct repository *r,
> > init_checkout_metadata(&unpack_tree_opts.meta, name, &oid, NULL);
> >
> > if (repo_read_index_unmerged(r)) {
> > - ret = error_resolve_conflict(_(action_name(opts)));
> > + ret = error_resolve_conflict(action_name(opts));
> > goto cleanup;
> > }
>
> Perhaps we should have the error_resolve_conflict() function take a
> "enum replay_action" instead?We could do that. We could also just delete the sequencer code. It's just that both are a bad idea.
Ciao, Johannes