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

Function LoadGlobalPatterns

plumbing/format/gitignore/dir.go:126–133  ·  view source on GitHub ↗

LoadGlobalPatterns loads gitignore patterns from the gitignore file declared in a user's ~/.gitconfig file. If the ~/.gitconfig file does not exist the function will return nil. If the core.excludesfile property is not declared, the function will return nil. If the file pointed to by the core.exc

(fs billy.Filesystem)

Source from the content-addressed store, hash-verified

124//
125// The function assumes fs is rooted at the root filesystem.
126func LoadGlobalPatterns(fs billy.Filesystem) (ps []Pattern, err error) {
127 home, err := os.UserHomeDir()
128 if err != nil {
129 return
130 }
131
132 return loadPatterns(fs, fs.Join(home, gitconfigFile))
133}
134
135// LoadSystemPatterns loads gitignore patterns from the gitignore file
136// declared in a system's /etc/gitconfig file. If the /etc/gitconfig file does

Calls 2

JoinMethod · 0.80
loadPatternsFunction · 0.70