aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/difftree/difftree.go
diff options
context:
space:
mode:
authorAlberto Cortés <alberto@sourced.tech>2017-02-22 15:11:30 +0100
committerAlberto Cortés <alberto@sourced.tech>2017-02-22 17:37:28 +0100
commitd27c741e3b68357e46cc0a85a33a184fecc05c29 (patch)
tree4a95f2a9ac14378e428ea2fa51010e77e8f2a2f7 /plumbing/difftree/difftree.go
parentb5da4e98571b02dc106de4f9b2cb2a298489f1b1 (diff)
downloadgo-git-d27c741e3b68357e46cc0a85a33a184fecc05c29.tar.gz
test for issue 279
Diffstat (limited to 'plumbing/difftree/difftree.go')
-rw-r--r--plumbing/difftree/difftree.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/plumbing/difftree/difftree.go b/plumbing/difftree/difftree.go
index 76c5f27..d38ad2c 100644
--- a/plumbing/difftree/difftree.go
+++ b/plumbing/difftree/difftree.go
@@ -12,10 +12,6 @@ func DiffTree(a, b *object.Tree) ([]*Change, error) {
from := newTreeNoder(a)
to := newTreeNoder(b)
- hashEqual := func(a, b noder.Hasher) bool {
- return bytes.Equal(a.Hash(), b.Hash())
- }
-
merkletrieChanges, err := merkletrie.DiffTree(from, to, hashEqual)
if err != nil {
return nil, err
@@ -23,3 +19,7 @@ func DiffTree(a, b *object.Tree) ([]*Change, error) {
return newChanges(merkletrieChanges)
}
+
+func hashEqual(a, b noder.Hasher) bool {
+ return bytes.Equal(a.Hash(), b.Hash())
+}