attr.c: explain the lack of attr-name syntax check in parse_attr()

Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jan 27, 2017 at 18:01 UTC 5a8840194b0525590f930163d72e87a0ab50ac0a
1 file changed +6
attr.c
+6
@@ -183,6 +183,12 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
183 return NULL;
184 }
185 } else {
186 + /*
187 + * As this function is always called twice, once with
188 + * e == NULL in the first pass and then e != NULL in
189 + * the second pass, no need for invalid_attr_name()
190 + * check here.
191 + */
192 if (*cp == '-' || *cp == '!') {
193 e->setto = (*cp == '-') ? ATTR__FALSE : ATTR__UNSET;
194 cp++;