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

This commit is contained in:
Audrius Butkevicius authored and Jakob Borg committed 2018-05-08 23:37:13 +02:00
1 parent 2343c82c33
commit a48a31e3f5
3 files changed
+54 -5

No files matched your search

+2 -3
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
}