Skip to content

Commit 9c1c814

Browse files
committed
sourceignore: return err of nested load
Signed-off-by: Hidde Beydals <hello@hidde.co>
1 parent 16d4a48 commit 9c1c814

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/sourceignore/sourceignore.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func ReadIgnoreFile(path string, domain []string) ([]gitignore.Pattern, error) {
100100
return ps, nil
101101
}
102102

103-
// LoadIgnorePatterns recursively loads the the IgnoreFile patterns found
103+
// LoadIgnorePatterns recursively loads the IgnoreFile patterns found
104104
// in the directory.
105105
func LoadIgnorePatterns(dir string, domain []string) ([]gitignore.Pattern, error) {
106106
ps, err := ReadIgnoreFile(filepath.Join(dir, IgnoreFile), domain)
@@ -114,7 +114,9 @@ func LoadIgnorePatterns(dir string, domain []string) ([]gitignore.Pattern, error
114114
for _, fi := range fis {
115115
if fi.IsDir() && fi.Name() != ".git" {
116116
var subps []gitignore.Pattern
117-
subps, err = LoadIgnorePatterns(filepath.Join(dir, fi.Name()), append(domain, fi.Name()))
117+
if subps, err = LoadIgnorePatterns(filepath.Join(dir, fi.Name()), append(domain, fi.Name())); err != nil {
118+
return nil, err
119+
}
118120
if len(subps) > 0 {
119121
ps = append(ps, subps...)
120122
}

0 commit comments

Comments
 (0)