diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-26 10:56:18 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-26 10:56:18 -0700 |
| commit | 9e2e07b2385e27492607848bb0c7fc2b351f79af (patch) | |
| tree | 5b7bf8f758a76a417cef3d39b625b34b33ca65fb | |
| parent | cbce79375392f457b1b9393e1eb750147838e096 (diff) | |
| download | seaweedfs-9e2e07b2385e27492607848bb0c7fc2b351f79af.tar.xz seaweedfs-9e2e07b2385e27492607848bb0c7fc2b351f79af.zip | |
tweak
| -rw-r--r-- | weed/filesys/fscache.go | 2 | ||||
| -rw-r--r-- | weed/filesys/fscache_test.go | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/weed/filesys/fscache.go b/weed/filesys/fscache.go index 9114c91b2..6edb286bf 100644 --- a/weed/filesys/fscache.go +++ b/weed/filesys/fscache.go @@ -95,7 +95,7 @@ func (c *FsCache) Move(oldPath util.FullPath, newPath util.FullPath) *FsNode { dir.name = target.name // target is not Dir, but a shortcut } if f, ok := src.node.(*File); ok { - f.Name = target.name // target is not Dir, but a shortcut + f.Name = target.name if f.entry != nil { f.entry.Name = f.Name } diff --git a/weed/filesys/fscache_test.go b/weed/filesys/fscache_test.go index 06ef7c454..67f9aacc8 100644 --- a/weed/filesys/fscache_test.go +++ b/weed/filesys/fscache_test.go @@ -11,6 +11,12 @@ func TestPathSplit(t *testing.T) { if len(parts) != 0 { t.Errorf("expecting an empty list, but getting %d", len(parts)) } + + parts = util.FullPath("/readme.md").Split() + if len(parts) != 1 { + t.Errorf("expecting an empty list, but getting %d", len(parts)) + } + } func TestFsCache(t *testing.T) { |
