From 4f1390436d695cc550452919b10d40948862bfd6 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 21 Sep 2025 15:58:29 +0200 Subject: [PATCH] init: remove duplication from error message --- cmd/restic/global.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 4478d589b..bb477b760 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -501,6 +501,10 @@ func innerOpen(ctx context.Context, s string, gopts GlobalOptions, opts options. return nil, fmt.Errorf("Fatal: %w at %v: %v", ErrNoRepository, location.StripPassword(gopts.backends, s), err) } if err != nil { + if create { + // init already wraps the error message + return nil, err + } return nil, errors.Fatalf("unable to open repository at %v: %v", location.StripPassword(gopts.backends, s), err) }