lib/ignores: Update lines even if patterns didn't change (fixes #4689)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4690
This commit is contained in:
Simon Frei
2018-01-20 07:52:57 +00:00
committed by Jakob Borg
parent 93b5180e62
commit 885e3f19bd
2 changed files with 27 additions and 1 deletions

View File

@@ -156,6 +156,8 @@ func (m *Matcher) parseLocked(r io.Reader, file string) error {
// Error is saved and returned at the end. We process the patterns
// (possibly blank) anyway.
m.lines = lines
newHash := hashPatterns(patterns)
if newHash == m.curHash {
// We've already loaded exactly these patterns.
@@ -163,7 +165,6 @@ func (m *Matcher) parseLocked(r io.Reader, file string) error {
}
m.curHash = newHash
m.lines = lines
m.patterns = patterns
if m.withCache {
m.matches = newCache(patterns)