Re: [PATCH v7 2/2] pull --rebase: add --[no-]autostash flag
- From
Mehul Jain <mehul.jain2029@gmail.com>
- Date
- Mar 11, 2016, 14:38 UTC
- Message-ID
- <CA+DCAeTRavhVb05sXsi-P5NKGw7xRAZLnc2-XC+8f6ZWZgsJhA@mail.gmail.com>
- In-Reply-To
- <vpq8u1p16rv.fsf@anie.imag.fr>
On Fri, Mar 11, 2016 at 7:00 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 9 quoted lines
> What Junio says is that you don't need to write > > static int config_autostash = 0; > > since it is equivalent to > > static int config_autostash; > > But there's nothing wrong with having a static variable defaulting to 0.
My bad. I should have read Junio's comment more carefully.
config_autostash can be default to 0. And thus
if (opt_autostash != 1)
die_on_unclean_work_tree(prefix);can be replaced by
if (!opt_autostash)
die_on_unclean_work_tree(prefix);and thus opt_autostash will be either 0 or 1 and we don't have to worry about it being -1 (whenever --rebase is passed).
I will make the changes accordingly.
Thanks, Mehul