1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-09 00:00:02 +01:00

SnapshotFilter is not empty if either NewerThan or OlderThan is set

This is required to allow `forget` without other snapshot limitations
This commit is contained in:
Kjetil Torgrim Homme 2025-02-10 20:12:37 +01:00
parent e588ee5bbe
commit 238d65ec3f

View file

@ -29,7 +29,7 @@ type SnapshotFilter struct {
}
func (f *SnapshotFilter) Empty() bool {
return len(f.Hosts)+len(f.Tags)+len(f.Paths) == 0
return len(f.Hosts)+len(f.Tags)+len(f.Paths) == 0 && f.NewerThan.Zero() && f.OlderThan.Zero()
}
func (f *SnapshotFilter) matches(sn *Snapshot) bool {