]> git.ipfire.org Git - thirdparty/git.git/commit - attr.c
attr: remove maybe-real, maybe-macro from git_attr
authorBrandon Williams <bmwill@google.com>
Sat, 28 Jan 2017 02:02:03 +0000 (18:02 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Feb 2017 21:46:53 +0000 (13:46 -0800)
commit60a12722ac80bc55b43581a7719d25d1bb7a9882
treea041d4168bd902110267acbc86127ed399da9107
parent685b2925757e98624e37abe09d49c205a7db5943
attr: remove maybe-real, maybe-macro from git_attr

Whether or not a git attribute is real or a macro isn't a property of
the attribute but rather it depends on the attribute stack (which
.gitattribute files were read).

This patch removes the 'maybe_real' and 'maybe_macro' fields in a
git_attr and instead adds the 'macro' field to a attr_check_item.  The
'macro' indicates (if non-NULL) that a particular attribute is a macro
for the given attribute stack.  It's populated, through a quick scan of
the attribute stack, with the match_attr that corresponds to the macro's
definition.  This way the attribute stack only needs to be scanned a
single time prior to attribute collection instead of each time a macro
needs to be expanded.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c