diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2019-09-03 21:04:56 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-09-06 00:05:12 +0300 |
commit | 4ff89ee52cd3cf6e38a11bb94e43df1b53c56eec (patch) | |
tree | b0db9808799b9d2f55e04df1a4c25ba5e461106c /attr.c | |
parent | caa3d5544474a6ef8e8d7db5c073c1564b76d8bb (diff) |
treewide: rename 'EXCL_FLAG_' to 'PATTERN_FLAG_'
The first consumer of pattern-matching filenames was the
.gitignore feature. In that context, storing a list of patterns
as a 'struct exclude_list' makes sense. However, the
sparse-checkout feature then adopted these structures and methods,
but with the opposite meaning: these patterns match the files
that should be included!
It would be clearer to rename this entire library as a "pattern
matching" library, and the callers apply exclusion/inclusion
logic accordingly based on their needs.
This commit replaces 'EXCL_FLAG_' to 'PATTERN_FLAG_' in the
names of the flags used on 'struct path_pattern'.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'attr.c')
-rw-r--r-- | attr.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -259,7 +259,7 @@ struct pattern { const char *pattern; int patternlen; int nowildcardlen; - unsigned flags; /* EXC_FLAG_* */ + unsigned flags; /* PATTERN_FLAG_* */ }; /* @@ -404,7 +404,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src, &res->u.pat.patternlen, &res->u.pat.flags, &res->u.pat.nowildcardlen); - if (res->u.pat.flags & EXC_FLAG_NEGATIVE) { + if (res->u.pat.flags & PATTERN_FLAG_NEGATIVE) { warning(_("Negative patterns are ignored in git attributes\n" "Use '\\!' for literal leading exclamation.")); goto fail_return; @@ -991,10 +991,10 @@ static int path_matches(const char *pathname, int pathlen, int prefix = pat->nowildcardlen; int isdir = (pathlen && pathname[pathlen - 1] == '/'); - if ((pat->flags & EXC_FLAG_MUSTBEDIR) && !isdir) + if ((pat->flags & PATTERN_FLAG_MUSTBEDIR) && !isdir) return 0; - if (pat->flags & EXC_FLAG_NODIR) { + if (pat->flags & PATTERN_FLAG_NODIR) { return match_basename(pathname + basename_offset, pathlen - basename_offset - isdir, pattern, prefix, |