summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-14 16:48:28 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-16 13:55:02 -0700
commit7566f4dc1290058438356bd5ed4ad3517b2e9c6e (patch)
treebb1d117b8c0ac135f230f06b438be9219624590b
parent642c6f2ae0840ef9625f924d0e3e6c14504b8e09 (diff)
downloadgit-7566f4dc1290058438356bd5ed4ad3517b2e9c6e.tar.gz
attr.c: explain the lack of attr-name syntax check in parse_attr()
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++;