From: Bagas Sanjaya Date: Sat, 11 Dec 2021 07:36:10 GMT Subject: Re: [PATCH V3] git-apply: add --allow-empty flag Message-ID: 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. > 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