Browse Source

tweak

pull/1255/head
Chris Lu 5 years ago
parent
commit
9e2e07b238
  1. 2
      weed/filesys/fscache.go
  2. 6
      weed/filesys/fscache_test.go

2
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
}

6
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) {

Loading…
Cancel
Save