Re: [PATCH V3] git-apply: add --allow-empty flag
- From
Bagas Sanjaya <bagasdotme@gmail.com>
- Date
- Dec 11, 2021, 07:36 UTC
- Message-ID
- <d8a07706-bbcc-059a-fd1e-6f0e920279a3@gmail.com>
- In-Reply-To
- <20211211031343.15818-1-jerry@skydio.com>
On 11/12/21 10.13, Jerry Zhang wrote:
> +--allow-empty:: > + Don't return error for patches containing no diff. This includes > + empty patches and patches with commit text only. > +
Looks OK.
Show 9 quoted lines
> if (!list && !skipped_patch) {
> - error(_("unrecognized input"));
> - res = -128;
> + if (!state->allow_empty) {
> + error(_("unrecognized input"));
> + res = -128;
> + }
> goto end;
> }When we apply empty patch but we forget --allow-empty, we got generic "unrecognized input". So for this case, we should disambiguate the former case and case when malformed patch input is provided.
-- An old man doll... just what I always wanted! - Clara