mirror of
https://github.com/restic/restic.git
synced 2025-08-27 09:50:24 +00:00
cmd, restic: Refactor and fix snapshot filtering
This turns snapshotFilterOptions from cmd into a restic.SnapshotFilter type and makes restic.FindFilteredSnapshot and FindFilteredSnapshots methods on that type. This fixes #4211 by ensuring that hosts and paths are named struct fields instead of unnamed function arguments in long lists of such. Timestamp limits are also included in the new type. To avoid too much pointer handling, the convention is that time zero means no limit. That's January 1st, year 1, 00:00 UTC, which is so unlikely a date that we can sacrifice it for simpler code.
This commit is contained in:

committed by
Michael Eischer

parent
74f7dd0b38
commit
97274ecabd
8
changelog/unreleased/issue-4211
Normal file
8
changelog/unreleased/issue-4211
Normal file
@@ -0,0 +1,8 @@
|
||||
Bugfix: Restic dump now interprets --host and --path correctly
|
||||
|
||||
Restic dump previously confused its --host=<host> and --path=<path>
|
||||
options: it looked for snapshots with paths called <host> from hosts
|
||||
called <path>. It now treats the options as intended.
|
||||
|
||||
https://github.com/restic/restic/issues/4211
|
||||
https://github.com/restic/restic/pull/4212
|
Reference in New Issue
Block a user