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)
| 108 | // the function will return nil. The function assumes fs is rooted at the root |
| 109 | // filesystem. |
| 110 | func 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 |