Re: [PATCH 63/83] builtin/apply: make apply_all_patches() return -1 on error
- From
Christian Couder <christian.couder@gmail.com>
- Date
- May 3, 2016, 13:01 UTC
- Message-ID
- <CAP8UFD3NXo4vMBK9-3LChWcoSj7y_nKeea-RLyGmdy7kVvhabA@mail.gmail.com>
- In-Reply-To
- <CAPig+cSVCDNRup95ay=htiXiw0UCGs6boDuqovGnQJY8imbFhQ@mail.gmail.com>
On Sun, May 1, 2016 at 11:03 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 15 quoted lines
>> @@ -4590,10 +4590,10 @@ static int apply_all_patches(struct apply_state *state,
>> squelched);
>> }
>> if (state->ws_error_action == die_on_ws_error)
>> - die(Q_("%d line adds whitespace errors.",
>> - "%d lines add whitespace errors.",
>> - state->whitespace_error),
>> - state->whitespace_error);
>> + return error(Q_("%d line adds whitespace errors.",
>> + "%d lines add whitespace errors.",
>> + state->whitespace_error),
>> + state->whitespace_error);
>
> How does this new 'return' relate to the logic below which updates the
> index? Does the index need to be updated here now too?I think it is the right thing to do not to update the index when there are whitespaces and state->ws_error_action == die_on_ws_error.