mirror of
https://github.com/restic/restic.git
synced 2024-12-22 15:57:07 +00:00
ls: fix broken folder if --ncdu an file filters are combined
This commit is contained in:
parent
be98402ac6
commit
894ec9d05d
1 changed files with 5 additions and 0 deletions
|
@ -367,9 +367,11 @@ func runLs(ctx context.Context, opts LsOptions, gopts GlobalOptions, args []stri
|
|||
return nil
|
||||
}
|
||||
|
||||
printedDir := false
|
||||
if withinDir(nodepath) {
|
||||
// if we're within a dir, print the node
|
||||
printer.Node(nodepath, node)
|
||||
printedDir = true
|
||||
|
||||
// if recursive listing is requested, signal the walker that it
|
||||
// should continue walking recursively
|
||||
|
@ -387,6 +389,9 @@ func runLs(ctx context.Context, opts LsOptions, gopts GlobalOptions, args []stri
|
|||
// otherwise, signal the walker to not walk recursively into any
|
||||
// subdirs
|
||||
if node.Type == "dir" {
|
||||
if printedDir {
|
||||
printer.LeaveDir(nodepath)
|
||||
}
|
||||
return walker.ErrSkipNode
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue