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

the commands which will definitely not operate on partial snapshots

This commit is contained in:
Winfried Plappert 2025-03-04 16:58:03 +00:00
parent e36b07f78b
commit 1873780d41
4 changed files with 17 additions and 0 deletions

View file

@ -129,6 +129,10 @@ func runCopy(ctx context.Context, opts CopyOptions, gopts GlobalOptions, args []
if sn.Original != nil {
srcOriginal = *sn.Original
}
err = checkPartialSnapshot(sn, "fatal", "copy")
if err != nil {
return err
}
if originalSns, ok := dstSnapshotByOriginal[srcOriginal]; ok {
isCopy := false

View file

@ -156,6 +156,10 @@ func runDump(ctx context.Context, opts DumpOptions, gopts GlobalOptions, args []
if err != nil {
return errors.Fatalf("failed to find snapshot: %v", err)
}
err = checkPartialSnapshot(sn, "fatal", "dump")
if err != nil {
return err
}
bar := newIndexProgress(gopts.Quiet, gopts.JSON)
err = repo.LoadIndex(ctx, bar)

View file

@ -145,6 +145,10 @@ func runRestore(ctx context.Context, opts RestoreOptions, gopts GlobalOptions,
if err != nil {
return errors.Fatalf("failed to find snapshot: %v", err)
}
err = checkPartialSnapshot(sn, "error", "restore")
if err != nil {
return err
}
bar := newIndexTerminalProgress(gopts.Quiet, gopts.JSON, term)
err = repo.LoadIndex(ctx, bar)

View file

@ -321,6 +321,11 @@ func runRewrite(ctx context.Context, opts RewriteOptions, gopts GlobalOptions, a
changedCount := 0
for sn := range FindFilteredSnapshots(ctx, snapshotLister, repo, &opts.SnapshotFilter, args) {
err = checkPartialSnapshot(sn, "fatal", "rewrite")
if err != nil {
return err
}
Verbosef("\n%v\n", sn)
changed, err := rewriteSnapshot(ctx, repo, sn, opts)
if err != nil {