summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-28 11:54:30 -0700
committerJunio C Hamano <gitster@pobox.com>2016-10-28 14:40:17 -0700
commit44f7f1ebd2a0a9f41cbd8d417ba3e94fe3821b9c (patch)
treef6da9cf877f7e3eb2b6f3f96d2188f8f906bd210
parentc77ada7f108856054b62f6f08682ae3b8d35a76c (diff)
downloadgit-44f7f1ebd2a0a9f41cbd8d417ba3e94fe3821b9c.tar.gz
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: Junio C Hamano <gitster@pobox.com>
-rw-r--r--attr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/attr.c b/attr.c
index 4ae78010e0..05db6671a7 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++;