MCPcopy Create free account
hub / github.com/go-git/go-git / ReadAttributesFile

Function ReadAttributesFile

plumbing/format/gitattributes/dir.go:21–33  ·  view source on GitHub ↗
(fs billy.Filesystem, path []string, attributesFile string, allowMacro bool)

Source from the content-addressed store, hash-verified

19)
20
21func ReadAttributesFile(fs billy.Filesystem, path []string, attributesFile string, allowMacro bool) ([]MatchAttribute, error) {
22 f, err := fs.Open(fs.Join(append(path, attributesFile)...))
23 if os.IsNotExist(err) {
24 return nil, nil
25 }
26 if err != nil {
27 return nil, err
28 }
29
30 defer gioutil.CheckClose(f, &err)
31
32 return ReadAttributes(f, path, allowMacro)
33}
34
35// ReadPatterns reads gitattributes patterns recursively through the directory
36// structure. The result is in ascending order of priority (last higher).

Callers 3

ReadPatternsFunction · 0.85
walkDirectoryFunction · 0.85
loadPatternsFunction · 0.85

Calls 3

ReadAttributesFunction · 0.85
JoinMethod · 0.80
OpenMethod · 0.45

Tested by

no test coverage detected