Revert and replace 31d95ac, 65acc7c, 87780a5

This commit is contained in:
Audrius Butkevicius
2014-10-14 21:30:00 +01:00
parent 87780a5b7e
commit ade437d625
4 changed files with 12 additions and 11 deletions

View File

@@ -120,13 +120,13 @@ func (m *Matcher) Match(file string) (result bool) {
func loadIgnoreFile(file string, seen map[string]bool) (*Matcher, error) {
if seen[file] {
return &Matcher{}, fmt.Errorf("Multiple include of ignore file %q", file)
return nil, fmt.Errorf("Multiple include of ignore file %q", file)
}
seen[file] = true
fd, err := os.Open(file)
if err != nil {
return &Matcher{}, err
return nil, err
}
defer fd.Close()
@@ -134,7 +134,7 @@ func loadIgnoreFile(file string, seen map[string]bool) (*Matcher, error) {
}
func parseIgnoreFile(fd io.Reader, currentFile string, seen map[string]bool) (*Matcher, error) {
exps := Matcher{}
var exps Matcher
addPattern := func(line string) error {
include := true
@@ -214,7 +214,7 @@ func parseIgnoreFile(fd io.Reader, currentFile string, seen map[string]bool) (*M
}
}
if err != nil {
return &exps, err
return nil, err
}
}