From: Junio C Hamano Date: Sat, 28 Jan 2017 02:01:44 +0000 (-0800) Subject: attr.c: explain the lack of attr-name syntax check in parse_attr() X-Git-Tag: v2.13.0-rc0~169^2~23 X-Git-Url: http://git.bitbasher.net/?a=commitdiff_plain;h=5a8840194b0525590f930163d72e87a0ab50ac0a;p=git.git attr.c: explain the lack of attr-name syntax check in parse_attr() Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- diff --git a/attr.c b/attr.c index 007f1a2995..6b55a57ef7 100644 --- a/attr.c +++ b/attr.c @@ -183,6 +183,12 @@ static const char *parse_attr(const char *src, int lineno, const char *cp, return NULL; } } else { + /* + * As this function is always called twice, once with + * e == NULL in the first pass and then e != NULL in + * the second pass, no need for invalid_attr_name() + * check here. + */ if (*cp == '-' || *cp == '!') { e->setto = (*cp == '-') ? ATTR__FALSE : ATTR__UNSET; cp++;