archiver: pass ItemAction to progress reporter instead of data.Node (#21886)

This commit is contained in:
Michael Eischer authored and GitHub committed 2026-06-20 19:06:45 +02:00
1 parent 57ac5d107c
commit 532f36a5a8
4 files changed
+84 -56

No files matched your search

+2 -5
View File
@@ -6,7 +6,6 @@ import (
"time"
"github.com/restic/restic/internal/archiver"
"github.com/restic/restic/internal/data"
"github.com/restic/restic/internal/restic"
)
@@ -54,11 +53,9 @@ func TestProgress(t *testing.T) {
prog.CompleteBlob(1024)
// "dir unchanged"
node := data.Node{Type: data.NodeTypeDir}
prog.CompleteItem("foo", &node, &node, archiver.ItemStats{}, 0)
prog.CompleteItem("foo", archiver.ActionDirUnchanged, archiver.ItemStats{}, 0)
// "file new"
node.Type = data.NodeTypeFile
prog.CompleteItem("foo", nil, &node, archiver.ItemStats{}, 0)
prog.CompleteItem("foo", archiver.ActionFileNew, archiver.ItemStats{}, 0)
time.Sleep(10 * time.Millisecond)
id := restic.NewRandomID()