From 09cddb89279d426d1807b78ee93b366d126502c9 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 17 Apr 2023 21:00:45 +0200 Subject: [PATCH] rewrite: log snapshot saved before removal of the old snapshot The snapshot was already saved before removing the old snapshot. Only the log messages were printed in the wrong order. --- cmd/restic/cmd_rewrite.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/cmd_rewrite.go b/cmd/restic/cmd_rewrite.go index 8a1b860ed..744686390 100644 --- a/cmd/restic/cmd_rewrite.go +++ b/cmd/restic/cmd_rewrite.go @@ -136,6 +136,7 @@ func rewriteSnapshot(ctx context.Context, repo *repository.Repository, sn *resti if err != nil { return false, err } + Verbosef("saved new snapshot %v\n", id.Str()) if opts.Forget { h := restic.Handle{Type: restic.SnapshotFile, Name: sn.ID().String()} @@ -145,7 +146,6 @@ func rewriteSnapshot(ctx context.Context, repo *repository.Repository, sn *resti debug.Log("removed old snapshot %v", sn.ID()) Verbosef("removed old snapshot %v\n", sn.ID().Str()) } - Verbosef("saved new snapshot %v\n", id.Str()) return true, nil }