Skip to content

Commit

Permalink
fix tree copy ref to parent tree
Browse files Browse the repository at this point in the history
  • Loading branch information
wagoodman committed Jun 1, 2018
1 parent 563d4b3 commit 2a1929b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions filetree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2a1929b

Please sign in to comment.