forked from TrueCloudLab/rclone
acd, onedrive: make sure we have found the root before purging
If we don't, purge can try to trash the root node which fortunately doesn't succeed.
This commit is contained in:
parent
1fa258c2b4
commit
0604d3dbf2
2 changed files with 8 additions and 0 deletions
|
@ -753,6 +753,10 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
|
||||||
return errors.New("can't purge root directory")
|
return errors.New("can't purge root directory")
|
||||||
}
|
}
|
||||||
dc := f.dirCache
|
dc := f.dirCache
|
||||||
|
err := dc.FindRoot(false)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
rootID, err := dc.FindDir(dir, false)
|
rootID, err := dc.FindDir(dir, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -491,6 +491,10 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
|
||||||
return errors.New("can't purge root directory")
|
return errors.New("can't purge root directory")
|
||||||
}
|
}
|
||||||
dc := f.dirCache
|
dc := f.dirCache
|
||||||
|
err := dc.FindRoot(false)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
rootID, err := dc.FindDir(dir, false)
|
rootID, err := dc.FindDir(dir, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue