MCPcopy
hub / github.com/syncthing/syncthing / folderIgnoresAlwaysReload

Function folderIgnoresAlwaysReload

lib/model/testutils_test.go:250–257  ·  view source on GitHub ↗

Reach in and update the ignore matcher to one that always does reloads when asked to, instead of checking file mtimes. This is because we will be changing the files on disk often enough that the mtimes will be unreliable to determine change status.

(t testing.TB, m *testModel, fcfg config.FolderConfiguration)

Source from the content-addressed store, hash-verified

248// because we will be changing the files on disk often enough that the
249// mtimes will be unreliable to determine change status.
250func folderIgnoresAlwaysReload(t testing.TB, m *testModel, fcfg config.FolderConfiguration) {
251 t.Helper()
252 m.removeFolder(fcfg)
253 ignores := ignore.New(fcfg.Filesystem(), ignore.WithCache(true), ignore.WithChangeDetector(newAlwaysChanged()))
254 m.mut.Lock()
255 m.addAndStartFolderLockedWithIgnores(fcfg, ignores)
256 m.mut.Unlock()
257}
258
259func basicClusterConfig(local, remote protocol.DeviceID, folders ...string) *protocol.ClusterConfig {
260 var cc protocol.ClusterConfig

Callers 3

TestIgnoresFunction · 0.85
pullInvalidIgnoredFunction · 0.85
TestIgnoreDeleteUnignoreFunction · 0.85

Calls 9

NewFunction · 0.92
WithCacheFunction · 0.92
WithChangeDetectorFunction · 0.92
newAlwaysChangedFunction · 0.85
HelperMethod · 0.80
removeFolderMethod · 0.80
FilesystemMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected