lib/config: Ignored folders that are added to the config should not remain ignored (fixes #4219)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4220
This commit is contained in:
committed by
Audrius Butkevicius
parent
98cfc204ca
commit
8f214fe4a9
@@ -268,6 +268,14 @@ func (cfg *Configuration) clean() error {
|
||||
seenFolders[folder.ID] = struct{}{}
|
||||
}
|
||||
|
||||
// Remove ignored folders that are anyway part of the configuration.
|
||||
for i := 0; i < len(cfg.IgnoredFolders); i++ {
|
||||
if _, ok := seenFolders[cfg.IgnoredFolders[i]]; ok {
|
||||
cfg.IgnoredFolders = append(cfg.IgnoredFolders[:i], cfg.IgnoredFolders[i+1:]...)
|
||||
i-- // IgnoredFolders[i] now points to something else, so needs to be rechecked
|
||||
}
|
||||
}
|
||||
|
||||
cfg.Options.ListenAddresses = util.UniqueStrings(cfg.Options.ListenAddresses)
|
||||
cfg.Options.GlobalAnnServers = util.UniqueStrings(cfg.Options.GlobalAnnServers)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user