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

Function LoadGlobalPatterns

plumbing/format/gitattributes/dir.go:110–117  ·  view source on GitHub ↗

LoadGlobalPatterns loads gitattributes patterns and attributes from the gitattributes file declared in a user's ~/.gitconfig file. If the ~/.gitconfig file does not exist the function will return nil. If the core.attributesFile property is not declared, the function will return nil. If the file poi

(fs billy.Filesystem)

Source from the content-addressed store, hash-verified

108// the function will return nil. The function assumes fs is rooted at the root
109// filesystem.
110func LoadGlobalPatterns(fs billy.Filesystem) (attributes []MatchAttribute, err error) {
111 home, err := os.UserHomeDir()
112 if err != nil {
113 return
114 }
115
116 return loadPatterns(fs, fs.Join(home, gitconfigFile))
117}
118
119// LoadSystemPatterns loads gitattributes patterns and attributes from the
120// gitattributes file declared in a system's /etc/gitconfig file. If the

Calls 2

JoinMethod · 0.80
loadPatternsFunction · 0.70