forked from TrueCloudLab/rclone
Make --include rules add their implict exclude * at the end of the filter list
This means you can mix `--include` and `--include-from` with the other filters (eg `--exclude`) but you must include all the files you want in the include statement. Fixes #280
This commit is contained in:
parent
01aa4394a6
commit
af5f4ee724
3 changed files with 21 additions and 15 deletions
|
@ -147,16 +147,15 @@ func TestNewFilterFull(t *testing.T) {
|
|||
}
|
||||
got := f.DumpFilters()
|
||||
want := `+ (^|/)include1$
|
||||
- (^|/)[^/]*$
|
||||
+ (^|/)include2$
|
||||
+ (^|/)include3$
|
||||
- (^|/)[^/]*$
|
||||
- (^|/)exclude1$
|
||||
- (^|/)exclude2$
|
||||
- (^|/)exclude3$
|
||||
- (^|/)filter1$
|
||||
+ (^|/)filter2$
|
||||
- (^|/)filter3$`
|
||||
- (^|/)filter3$
|
||||
- (^|/)[^/]*$`
|
||||
if got != want {
|
||||
t.Errorf("rules want %s got %s", want, got)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue