mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Don't warn about failed ignores if folder unhealthy (fixes #2630)
This commit is contained in:
parent
62a81cfdd1
commit
80b9a3e00b
@ -893,6 +893,10 @@ func (m *Model) GetIgnores(folder string) ([]string, []string, error) {
|
|||||||
return lines, nil, fmt.Errorf("Folder %s does not exist", folder)
|
return lines, nil, fmt.Errorf("Folder %s does not exist", folder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !cfg.HasMarker() {
|
||||||
|
return lines, nil, fmt.Errorf("Folder %s stopped", folder)
|
||||||
|
}
|
||||||
|
|
||||||
fd, err := os.Open(filepath.Join(cfg.Path(), ".stignore"))
|
fd, err := os.Open(filepath.Join(cfg.Path(), ".stignore"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
|
@ -514,13 +514,11 @@ func TestIgnores(t *testing.T) {
|
|||||||
t.Error("No error")
|
t.Error("No error")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Invalid path, marker should be missing, hence returns an error.
|
||||||
m.AddFolder(config.FolderConfiguration{ID: "fresh", RawPath: "XXX"})
|
m.AddFolder(config.FolderConfiguration{ID: "fresh", RawPath: "XXX"})
|
||||||
ignores, _, err = m.GetIgnores("fresh")
|
ignores, _, err = m.GetIgnores("fresh")
|
||||||
if err != nil {
|
if err == nil {
|
||||||
t.Error(err)
|
t.Error("No error")
|
||||||
}
|
|
||||||
if len(ignores) > 0 {
|
|
||||||
t.Errorf("Expected no ignores, got: %v", ignores)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user