From 248e3218cbe8ef43076911e27d19c8275456dc9f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 6 Jan 2015 22:06:57 +0100 Subject: [PATCH] Incremental: Check if node type is still the same --- tree.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tree.go b/tree.go index cd665dc00..5010e418b 100644 --- a/tree.go +++ b/tree.go @@ -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 {