mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
This commit is contained in:
parent
8a4c00d82e
commit
97a8777d03
@ -224,6 +224,13 @@ func (f *caseFilesystem) Rename(oldpath, newpath string) error {
|
|||||||
if err := f.checkCase(oldpath); err != nil {
|
if err := f.checkCase(oldpath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := f.checkCase(newpath); err != nil {
|
||||||
|
// Case-only rename is ok
|
||||||
|
e := &ErrCaseConflict{}
|
||||||
|
if !errors.As(err, &e) || e.Real != oldpath {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
if err := f.Filesystem.Rename(oldpath, newpath); err != nil {
|
if err := f.Filesystem.Rename(oldpath, newpath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user