mirror of
https://github.com/restic/restic.git
synced 2026-11-22 05:14:23 +00:00
restic rewrite --include
added function Count() to the *TreeWriter methods
This commit is contained in:
1 parent
b6af01bb28
commit
ee154ce0ab
1 file changed
+6
@@ -223,6 +223,12 @@ func (t *TreeWriter) Finalize(ctx context.Context) (restic.ID, error) {
|
|||||||
return id, err
|
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) {
|
func SaveTree(ctx context.Context, saver restic.BlobSaver, nodes TreeNodeIterator) (restic.ID, error) {
|
||||||
treeWriter := NewTreeWriter(saver)
|
treeWriter := NewTreeWriter(saver)
|
||||||
for item := range nodes {
|
for item := range nodes {
|
||||||
|
|||||||
Reference in new issue
Block a user