mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
lib/model: Don't remove non-empty .stfolder (#7578)
This commit is contained in:
parent
130d14cec9
commit
e4c995a321
@ -475,8 +475,13 @@ func (m *model) removeFolder(cfg config.FolderConfiguration) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isPathUnique {
|
if isPathUnique {
|
||||||
// Delete syncthing specific files
|
// Remove (if empty and removable) or move away (if non-empty or
|
||||||
cfg.Filesystem().RemoveAll(config.DefaultMarkerName)
|
// otherwise not removable) Syncthing-specific marker files.
|
||||||
|
fs := cfg.Filesystem()
|
||||||
|
if err := fs.Remove(config.DefaultMarkerName); err != nil {
|
||||||
|
moved := config.DefaultMarkerName + time.Now().Format(".removed-20060102-150405")
|
||||||
|
_ = fs.Rename(config.DefaultMarkerName, moved)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m.cleanupFolderLocked(cfg)
|
m.cleanupFolderLocked(cfg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user