Merge pull request #1397 from jkutner/add-to-ignore-list

Add func to append to ignorelist
This commit is contained in:
Tejal Desai
2020-08-27 17:46:14 -07:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
+4
View File
@@ -90,6 +90,10 @@ func IgnoreList() []IgnoreListEntry {
return ignorelist
}
func AddToIgnoreList(entry IgnoreListEntry) {
ignorelist = append(ignorelist, entry)
}
func IncludeWhiteout() FSOpt {
return func(opts *FSConfig) {
opts.includeWhiteout = true
+11
View File
@@ -78,6 +78,17 @@ func Test_DetectFilesystemSkiplist(t *testing.T) {
testutil.CheckErrorAndDeepEqual(t, false, err, expectedSkiplist, actualSkiplist)
}
func Test_AddToIgnoreList(t *testing.T) {
AddToIgnoreList(IgnoreListEntry{
Path: "/tmp",
PrefixMatchOnly: false,
})
if !CheckIgnoreList("/tmp") {
t.Errorf("CheckIgnoreList() = %v, want %v", false, true)
}
}
var tests = []struct {
files map[string]string
directory string