mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-22 00:15:39 +00:00
walk: filter \set keywords correctly
When checking if a new set is needed (curSet != nil), curSet wasn't being filtered against the actual keywords a user specifies. Thus, if `defaultSetKeywords` includes "flags", but the `keywords` argument for Walk() doesn't include "flags", "flags" was included in the new \set, which isn't expected behavior. Instead, we want to use keywordSelector function to make sure that we use intended user-specified keywords. Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
parent
52a31746bf
commit
0223187e76
1 changed files with 1 additions and 1 deletions
2
walk.go
2
walk.go
|
@ -106,7 +106,7 @@ func Walk(root string, exlcudes []ExcludeFunc, keywords []string) (*DirectoryHie
|
|||
Name: "/set",
|
||||
Type: SpecialType,
|
||||
Pos: len(creator.DH.Entries),
|
||||
Keywords: append(defaultSetKeywords, klist...),
|
||||
Keywords: keywordSelector(append(defaultSetKeywords, klist...), keywords),
|
||||
}
|
||||
creator.curSet = &e
|
||||
creator.DH.Entries = append(creator.DH.Entries, e)
|
||||
|
|
Loading…
Reference in a new issue