backend/cache: use backend types not restic types (#21860)

This commit is contained in:
Michael Eischer authored and GitHub committed 2026-06-10 22:45:39 +02:00
1 parent a15b1579ff
commit c745f810b3
7 files changed
+41 -49

No files matched your search

+2 -10
View File
@@ -7,7 +7,6 @@ import (
"github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/restic"
)
// Backend wraps a restic.Backend and adds a cache.
@@ -224,18 +223,11 @@ func (b *Backend) List(ctx context.Context, t backend.FileType, fn func(f backen
return b.Backend.List(ctx, t, fn)
}
// will contain the IDs of the files that are in the repository
ids := restic.NewIDSet()
ids := make(map[string]struct{})
// wrap the original function to also add the file to the ids set
wrapFn := func(f backend.FileInfo) error {
id, err := restic.ParseID(f.Name)
if err != nil {
// ignore files with invalid name
return nil
}
ids.Insert(id)
ids[f.Name] = struct{}{}
// execute the original function
return fn(f)