forked from TrueCloudLab/restic
parent
42a8c19aae
commit
7d8765a937
12 changed files with 49 additions and 15 deletions
|
@ -252,15 +252,27 @@ func (b *Local) List(ctx context.Context, t restic.FileType) <-chan string {
|
|||
go func() {
|
||||
defer close(ch)
|
||||
|
||||
err := fs.Walk(b.Basedir(t), func(path string, fi os.FileInfo, err error) error {
|
||||
basedir, subdirs := b.Basedir(t)
|
||||
err := fs.Walk(basedir, func(path string, fi os.FileInfo, err error) error {
|
||||
debug.Log("walk on %v, %v\n", path, fi.IsDir())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if path == basedir {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !isFile(fi) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if fi.IsDir() && !subdirs {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
||||
debug.Log("send %v\n", filepath.Base(path))
|
||||
|
||||
select {
|
||||
case ch <- filepath.Base(path):
|
||||
case <-ctx.Done():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue