diff options
| author | Derrick Stolee <dstolee@microsoft.com> | 2019-09-03 11:04:56 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-09-05 14:05:11 -0700 |
| commit | caa3d5544474a6ef8e8d7db5c073c1564b76d8bb (patch) | |
| tree | 76203b7747cbc9665cf97700947ed52ddd075e4d /builtin/ls-files.c | |
| parent | ab8db61390afd803ddd9778f84ba4c28dfa975c6 (diff) | |
| download | git-caa3d5544474a6ef8e8d7db5c073c1564b76d8bb.tar.gz | |
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 'builtin/ls-files.c')
| -rw-r--r-- | builtin/ls-files.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 7f83c9a6f2..df8918a128 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -516,7 +516,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) int require_work_tree = 0, show_tag = 0, i; const char *max_prefix; struct dir_struct dir; - struct exclude_list *el; + struct pattern_list *pl; struct string_list exclude_list = STRING_LIST_INIT_NODUP; struct option builtin_ls_files_options[] = { /* Think twice before adding "--nul" synonym to this */ @@ -594,9 +594,9 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) argc = parse_options(argc, argv, prefix, builtin_ls_files_options, ls_files_usage, 0); - el = add_exclude_list(&dir, EXC_CMDL, "--exclude option"); + pl = add_exclude_list(&dir, EXC_CMDL, "--exclude option"); for (i = 0; i < exclude_list.nr; i++) { - add_exclude(exclude_list.items[i].string, "", 0, el, --exclude_args); + add_exclude(exclude_list.items[i].string, "", 0, pl, --exclude_args); } if (show_tag || show_valid_bit || show_fsmonitor_bit) { tag_cached = "H "; |
