Re: [PATCH] pathspec: prevent empty strings as pathspecs
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 19, 2016, 02:23 UTC
- Message-ID
- <CAPig+cR5V7ZX8J9caYKTv4ECG_GP=N6geYQ+eReigicUC27cnA@mail.gmail.com>
- In-Reply-To
- <1466300967.28660.9.camel@frank>
On Sat, Jun 18, 2016 at 9:49 PM, David Turner <novalis@novalis.org> wrote:
Show 7 quoted lines
> On Sat, 2016-06-18 at 20:57 -0400, Emily Xie wrote:
>> + while (argv[n]) {
>> + if (*argv[n] == '\0') {
>> + die("Empty string is not a valid pathspec.");
>> + }
>
> nit: git style doesn't use {} on one-statement ifs.Also, drop the full-stop (period) from the error message and, to be consistent with modern practice, don't capitalize the first word. Finally, the string should be localizable, so wrap it in _(...):
die(_("empty string not valid pathspec"));