Skip to content

FileList#<< should skip excluded entries#750

Open
chatman-media wants to merge 1 commit into
ruby:masterfrom
chatman-media:fix/filelist-shovel-respects-exclude
Open

FileList#<< should skip excluded entries#750
chatman-media wants to merge 1 commit into
ruby:masterfrom
chatman-media:fix/filelist-shovel-respects-exclude

Conversation

@chatman-media

Copy link
Copy Markdown

Ran into an inconsistency between include and << on FileList: exclude("abc.c") followed by include("abc.c") correctly drops it, but the same thing with << leaves abc.c sitting in the list. Turns out << never checked exclusion at all — it just pushed straight onto @items, unlike add_matching which already guards with excluded_from_list? before appending glob matches.

Fixed << to skip the append when the item matches an exclude pattern, same check add_matching already does. Added a test that exercises exclude + << together (also confirmed test_append and friends still pass with no excludes set, so plain chaining is untouched).

Also relevant to #637, which reported the same thing.

include() has always filtered out anything matching an exclude
pattern, but << just appended straight to @Items with no check.
So exclude("abc.c") followed by << "abc.c" left abc.c in the
list, while the equivalent include("abc.c") correctly dropped it.
Added a test for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant