fix tree copy ref to parent tree

This commit is contained in:
Alex Goodman 2018-06-01 17:35:04 -04:00
parent 563d4b3610
commit 2a1929b97e
No known key found for this signature in database
GPG Key ID: 05328C611D8A520E

View File

@ -93,6 +93,10 @@ func (tree *FileTree) Copy() *FileTree {
newTree := NewTree()
*newTree = *tree
newTree.root = tree.Root().Copy()
newTree.Visit(func(node *FileNode) error {
node.tree = newTree
return nil
})
return newTree
}