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:11 +0300 |
commit | caa3d5544474a6ef8e8d7db5c073c1564b76d8bb (patch) | |
tree | 76203b7747cbc9665cf97700947ed52ddd075e4d /list-objects-filter.c | |
parent | ab8db61390afd803ddd9778f84ba4c28dfa975c6 (diff) |
treewide: rename 'struct exclude_list' to 'struct pattern_list'
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 renames 'struct exclude_list' to 'struct pattern_list'
and renames several variables called 'el' to 'pl'.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects-filter.c')
-rw-r--r-- | list-objects-filter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/list-objects-filter.c b/list-objects-filter.c index d664264d65..a1fedf8bd8 100644 --- a/list-objects-filter.c +++ b/list-objects-filter.c @@ -347,7 +347,7 @@ struct frame { }; struct filter_sparse_data { - struct exclude_list el; + struct pattern_list pl; size_t nr, alloc; struct frame *array_frame; @@ -374,7 +374,7 @@ static enum list_objects_filter_result filter_sparse( assert(obj->type == OBJ_TREE); dtype = DT_DIR; val = is_excluded_from_list(pathname, strlen(pathname), - filename, &dtype, &filter_data->el, + filename, &dtype, &filter_data->pl, r->index); if (val < 0) val = filter_data->array_frame[filter_data->nr - 1].defval; @@ -436,7 +436,7 @@ static enum list_objects_filter_result filter_sparse( dtype = DT_REG; val = is_excluded_from_list(pathname, strlen(pathname), - filename, &dtype, &filter_data->el, + filename, &dtype, &filter_data->pl, r->index); if (val < 0) val = frame->defval; @@ -483,7 +483,7 @@ static void filter_sparse_oid__init( { struct filter_sparse_data *d = xcalloc(1, sizeof(*d)); if (add_excludes_from_blob_to_list(filter_options->sparse_oid_value, - NULL, 0, &d->el) < 0) + NULL, 0, &d->pl) < 0) die("could not load filter specification"); ALLOC_GROW(d->array_frame, d->nr + 1, d->alloc); |