mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +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 {
|
||||
// Delete syncthing specific files
|
||||
cfg.Filesystem().RemoveAll(config.DefaultMarkerName)
|
||||
// Remove (if empty and removable) or move away (if non-empty or
|
||||
// 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)
|
||||
|
Loading…
Reference in New Issue
Block a user