aboutsummaryrefslogtreecommitdiffstats
path: root/utils/merkletrie/difftree.go
diff options
context:
space:
mode:
authorAlberto Cortés <alcortesm@gmail.com>2017-02-22 16:45:46 +0100
committerGitHub <noreply@github.com>2017-02-22 16:45:46 +0100
commitb5da4e98571b02dc106de4f9b2cb2a298489f1b1 (patch)
tree26f44140f9bf4dc5291e0b88c9f4f91354afffad /utils/merkletrie/difftree.go
parenta79bc09bdc6517e0dc9cc5f7936cf6312c3c1db3 (diff)
downloadgo-git-b5da4e98571b02dc106de4f9b2cb2a298489f1b1.tar.gz
Fix issue 275 (edited) (#276)
Fix #275 . It was not possible to write a test for this issue as the original fsnoder didn't support filenames with length > 1. Therefore this patch has 3 commits: add support for long filenames in fsnoder. add a test case for the issue using the new long filenames from step 1. fix the issue by comparing paths level by level instead of lexigographically over the whole path.
Diffstat (limited to 'utils/merkletrie/difftree.go')
-rw-r--r--utils/merkletrie/difftree.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/utils/merkletrie/difftree.go b/utils/merkletrie/difftree.go
index 1a626cd..7bea55f 100644
--- a/utils/merkletrie/difftree.go
+++ b/utils/merkletrie/difftree.go
@@ -249,7 +249,6 @@ package merkletrie
import (
"fmt"
- "strings"
"srcd.works/go-git.v4/utils/merkletrie/noder"
)
@@ -302,7 +301,7 @@ func diffNodes(changes *Changes, ii *doubleIter) error {
var err error
// compare their full paths as strings
- switch strings.Compare(from.String(), to.String()) {
+ switch from.Compare(to) {
case -1:
if err = changes.AddRecursiveDelete(from); err != nil {
return err