From: Johannes Schindelin Date: Mon, 18 May 2015 19:02:32 GMT Subject: Re: [PATCH 06/14] pull: support pull.ff config Message-ID: <86694e742e55b6db71ec30d43c5643d7@www.dscho.org> In-Reply-To: <1431961571-20370-7-git-send-email-pyokagan@gmail.com> Hi Paul, On 2015-05-18 17:06, Paul Tan wrote: > diff --git a/builtin/pull.c b/builtin/pull.c > index 8982fdf..b305a47 100644 > --- a/builtin/pull.c > +++ b/builtin/pull.c > @@ -209,6 +209,28 @@ static void argv_push_force(struct argv_array *arr) > argv_array_push(arr, "-f"); > } > > +/** > + * If pull.ff is "true", returns "--ff". If pull.ff is "false", returns > + * "--no-ff". If pull.ff is "only", returns "--ff-only". Otherwise, returns > + * NULL. > + */ > +static const char *config_get_ff(void) > +{ > + const char *value; > + > + if (git_config_get_value("pull.ff", &value)) > + return NULL; > + switch (git_config_maybe_bool("pull.ff", value)) { > + case 0: > + return "--no-ff"; > + case 1: > + return "--ff"; > + } > + if (!strcmp("pull.ff", "only")) I think you want to test `!strcmp("only", value)` ;-) Ciao, Dscho