restic rewrite --include

added function Count() to the *TreeWriter methods
This commit is contained in:
Winfried Plappert 2026-01-31 19:58:29 +00:00
parent b6af01bb28
commit ee154ce0ab

View file

@ -223,6 +223,12 @@ func (t *TreeWriter) Finalize(ctx context.Context) (restic.ID, error) {
return id, err
}
// Count returns the number of nodes in the tree
func (t *TreeWriter) Count() int {
return t.builder.countNodes
}
func SaveTree(ctx context.Context, saver restic.BlobSaver, nodes TreeNodeIterator) (restic.ID, error) {
treeWriter := NewTreeWriter(saver)
for item := range nodes {