File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -126,15 +126,25 @@ func (s *storage) Rename(from, to string) error {
126
126
from := ops [0 ]
127
127
to := ops [1 ]
128
128
129
- s .files [to ] = s .files [from ]
130
- s .children [to ] = s .children [from ]
131
- delete (s .children , from )
132
- delete (s .files , from )
129
+ if err := s .move (from , to ); err != nil {
130
+ return err
131
+ }
133
132
}
134
133
135
134
return nil
136
135
}
137
136
137
+ func (s * storage ) move (from , to string ) error {
138
+ s .files [to ] = s .files [from ]
139
+ s .files [to ].BaseFilename = filepath .Base (to )
140
+ s .children [to ] = s .children [from ]
141
+
142
+ delete (s .children , from )
143
+ delete (s .files , from )
144
+
145
+ return s .createParent (to , 0644 , s .files [to ])
146
+ }
147
+
138
148
func (s * storage ) Remove (path string ) error {
139
149
path = filepath .Clean (path )
140
150
You can’t perform that action at this time.
0 commit comments