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)
| 124 | // |
| 125 | // The function assumes fs is rooted at the root filesystem. |
| 126 | func 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 |