summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-01-28 02:01:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-01 21:46:52 (GMT)
commit5a8840194b0525590f930163d72e87a0ab50ac0a (patch)
tree5db42c60254bf837258ee36b619d572d7c72ebe6 /attr.c
parent4894f4ffce3cc6c4664027de78c3bc281cda2979 (diff)
downloadgit-5a8840194b0525590f930163d72e87a0ab50ac0a.zip
git-5a8840194b0525590f930163d72e87a0ab50ac0a.tar.gz
git-5a8840194b0525590f930163d72e87a0ab50ac0a.tar.bz2
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>
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/attr.c b/attr.c
index 007f1a2..6b55a57 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++;