mirror of
https://github.com/octoleo/restic.git
synced 2024-11-23 05:12:10 +00:00
ls: Only skip directory nodes
Special case for Walk(): When SkipDir is returned for a non-dir node, the remaining nodes for the current tree are skipped. We don't want that.
This commit is contained in:
parent
7f617cfd7f
commit
ace5cc4ed3
@ -125,7 +125,15 @@ func runLs(opts LsOptions, gopts GlobalOptions, args []string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !walk {
|
if !walk {
|
||||||
return false, walker.SkipNode
|
if node.Type == "dir" {
|
||||||
|
// signal Walk() that it should not descend into the tree.
|
||||||
|
return false, walker.SkipNode
|
||||||
|
}
|
||||||
|
|
||||||
|
// we must not return SkipNode for non-dir nodes because
|
||||||
|
// then the remaining nodes in the same tree would be
|
||||||
|
// skipped, so return nil instead
|
||||||
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// this second iteration ensures that we get an exact match
|
// this second iteration ensures that we get an exact match
|
||||||
|
Loading…
Reference in New Issue
Block a user