diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index 0f4dabc84..237f15c09 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -83,7 +83,7 @@ type BackupOptions struct { ExcludeLargerThan string Stdin bool StdinFilename string - Tags restic.TagList + Tags restic.TagLists Host string FilesFrom []string FilesFromVerbatim []string @@ -682,7 +682,7 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina snapshotOpts := archiver.SnapshotOptions{ Excludes: opts.Excludes, - Tags: opts.Tags, + Tags: opts.Tags.Flatten(), Time: timeStamp, Hostname: opts.Host, ParentSnapshot: *parentSnapshotID, diff --git a/cmd/restic/integration_test.go b/cmd/restic/integration_test.go index be8ec2bd9..3d6175318 100644 --- a/cmd/restic/integration_test.go +++ b/cmd/restic/integration_test.go @@ -662,7 +662,7 @@ func TestBackupTags(t *testing.T) { "expected no tags, got %v", newest.Tags) parent := newest - opts.Tags = []string{"NL"} + opts.Tags = restic.TagLists{[]string{"NL"}} testRunBackup(t, "", []string{env.testdata}, opts, env.gopts) testRunCheck(t, env.gopts) newest, _ = testRunSnapshots(t, env.gopts)