Incremental: Check if node type is still the same

This commit is contained in:
Alexander Neumann 2015-01-06 22:06:57 +01:00
parent 33bcf31bae
commit 248e3218cb
1 changed files with 2 additions and 2 deletions

View File

@ -135,7 +135,7 @@ func (t Tree) CopyFrom(bl *BlobList, other Tree, otherBl *BlobList) error {
continue
}
if node.Type == "file" {
if node.Type == "file" && oldNode.Type == "file" {
// compare content
if node.SameContent(oldNode) {
// copy Content
@ -151,7 +151,7 @@ func (t Tree) CopyFrom(bl *BlobList, other Tree, otherBl *BlobList) error {
bl.Insert(blob)
}
}
} else {
} else if node.Type == "dir" && oldNode.Type == "dir" {
// fill in all subtrees from old subtree
err := node.tree.CopyFrom(bl, *oldNode.tree, otherBl)
if err != nil {