Subject: Re: [PATCH 1/3] pull: cleanup autostash check

From: Felipe Contreras <[email-masked]>
Date: Tue, 15 Jun 2021 06:09:04 -0500

Carlo Arenas wrote:
> On Sat, Jun 12, 2021 at 10:11 PM Felipe Contreras <
> [email-masked]> wrote:
> 
> > -       autostash = config_autostash;
> >         if (opt_rebase) {
> > +               int autostash = config_autostash;
> >                 if (opt_autostash != -1)
> >                         autostash = opt_autostash;
> >
> 
> since you are reducing the scope of the autostash variable anyway, why
> not refactor it additionally for clarity with (something like):
> 
>   int autostash = (opt_autostash != -1) ? opt_autostash : config_autostash;

Because I had like 15 branches on top of this, and wanted 1) to minimize
modifications, and 2) to minimize the chance of the patch being
rejected, and this is how the code was before f15e7cf5cc (pull: ff
--rebase --autostash works in dirty repo, 2017-06-01), so in theory
nobody could object.

But yeah, that version makes sense, and in fact I probably had such
cleanup in some branch.

-- 
Felipe Contreras