Re: [PATCH 06/14] pull: support pull.ff config
- From
Paul Tan <pyokagan@gmail.com>
- Date
- May 21, 2015, 09:53 UTC
- Message-ID
- <CACRoPnQoZRc_DPM+kqxXmrepa4tKy7wX6eVjRNNMV8Sf9ue0vw@mail.gmail.com>
- In-Reply-To
- <86694e742e55b6db71ec30d43c5643d7@www.dscho.org>
Hi,
On Tue, May 19, 2015 at 3:02 AM, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
Show 32 quoted lines
> 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)` ;-)Ugh >.<
Fixed, thanks for catching.
Regards, Paul