From ef618bdd3f1ccd53e53efd08b55375e7b3b6e949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jerome=20K=C3=BCttner?= Date: Wed, 14 Sep 2022 08:14:31 +0200 Subject: [PATCH] use os.Remove if path already exists on symlink restore --- internal/restic/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/restic/node.go b/internal/restic/node.go index 341d88118..bc64b7fc3 100644 --- a/internal/restic/node.go +++ b/internal/restic/node.go @@ -300,7 +300,7 @@ func (node Node) createSymlinkAt(path string) error { return nil } - if err := os.RemoveAll(path); err != nil && !errors.Is(err, os.ErrNotExist) { + if err := os.Remove(path); err != nil && !errors.Is(err, os.ErrNotExist) { return errors.Wrap(err, "Symlink") }