aboutsummaryrefslogtreecommitdiffstats
path: root/utils/merkletrie
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-04-23 18:36:50 +0200
committerGitHub <noreply@github.com>2020-04-23 18:36:50 +0200
commit218a744b6995a89f5c322aa58e79138d65392ea6 (patch)
tree385575e9f68787661fcd04840f6061b40658ab40 /utils/merkletrie
parent53f87846a196c856e00fe825bc5f29551b2ea524 (diff)
parent90696f07f3a64243c6f33963f5267ab98622db9f (diff)
downloadgo-git-218a744b6995a89f5c322aa58e79138d65392ea6.tar.gz
Merge pull request #38 from go-git/feature/difftree-renames
plumbing: detect renames by hash and similar content in diff tree
Diffstat (limited to 'utils/merkletrie')
-rw-r--r--utils/merkletrie/difftree.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/merkletrie/difftree.go b/utils/merkletrie/difftree.go
index 90d9c95..bd084b2 100644
--- a/utils/merkletrie/difftree.go
+++ b/utils/merkletrie/difftree.go
@@ -23,7 +23,7 @@ package merkletrie
// # Cases
//
-// When comparing noders in both trees you will found yourself in
+// When comparing noders in both trees you will find yourself in
// one of 169 possible cases, but if we ignore moves, we can
// simplify a lot the search space into the following table:
//
@@ -256,17 +256,21 @@ import (
)
var (
+ // ErrCanceled is returned whenever the operation is canceled.
ErrCanceled = errors.New("operation canceled")
)
// DiffTree calculates the list of changes between two merkletries. It
// uses the provided hashEqual callback to compare noders.
-func DiffTree(fromTree, toTree noder.Noder,
- hashEqual noder.Equal) (Changes, error) {
+func DiffTree(
+ fromTree,
+ toTree noder.Noder,
+ hashEqual noder.Equal,
+) (Changes, error) {
return DiffTreeContext(context.Background(), fromTree, toTree, hashEqual)
}
-// DiffTree calculates the list of changes between two merkletries. It
+// DiffTreeContext calculates the list of changes between two merkletries. It
// uses the provided hashEqual callback to compare noders.
// Error will be returned if context expires
// Provided context must be non nil