lib/ignores: Fix ignore loading, report errors to UI (fixes #4901) (#4932)

This commit is contained in:
Audrius Butkevicius
2018-05-08 22:37:13 +01:00
committed by Jakob Borg
parent 2343c82c33
commit a48a31e3f5
3 changed files with 54 additions and 5 deletions

View File

@@ -1490,11 +1490,10 @@ func (m *Model) GetIgnores(folder string) ([]string, []string, error) {
}
ignores, ok := m.folderIgnores[folder]
if ok {
return ignores.Lines(), ignores.Patterns(), nil
if !ok {
ignores = ignore.New(fs.NewFilesystem(cfg.FilesystemType, cfg.Path))
}
ignores = ignore.New(fs.NewFilesystem(cfg.FilesystemType, cfg.Path))
if err := ignores.Load(".stignore"); err != nil && !fs.IsNotExist(err) {
return nil, nil, err
}