diff --git a/cmd/restic/cmd_ls.go b/cmd/restic/cmd_ls.go index 9c7d8c0f4..e6d11fa78 100644 --- a/cmd/restic/cmd_ls.go +++ b/cmd/restic/cmd_ls.go @@ -106,7 +106,7 @@ func runLs(opts LsOptions, gopts GlobalOptions, args []string) error { // are not in matching trees or will not lead us to matching trees var walk bool for _, dir := range dirs { - approachingMatchingTree := fs.HasPathPrefix(nodeDir, dir) + approachingMatchingTree := fs.HasPathPrefix(nodepath, dir) inMatchingTree := fs.HasPathPrefix(dir, nodepath) // this condition is complex, but it basically requires that we