Merge duplicated readdir functionality

internal/archiver.readdir and internal/fs.ReadDir were unused.

internal/fs.ReadDirNames and internal/archiver.readdirnames were doing
nearly the same thing, except one sorted its output and opened with
fs.O_NOFOLLOW. Both were only used in internal/archiver.
This commit is contained in:
greatroar 2020-02-17 09:22:32 +01:00
parent 2f8aa2ce30
commit 79b882e901
4 changed files with 15 additions and 91 deletions

View file

@ -214,7 +214,7 @@ func unrollTree(f fs.FS, t *Tree) error {
// nodes, add the contents of Path to the nodes.
if t.Path != "" && len(t.Nodes) > 0 {
debug.Log("resolve path %v", t.Path)
entries, err := fs.ReadDirNames(f, t.Path)
entries, err := readdirnames(f, t.Path, 0)
if err != nil {
return err
}