diff options
Diffstat (limited to 'plumbing/format/gitignore/dir.go')
-rw-r--r-- | plumbing/format/gitignore/dir.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plumbing/format/gitignore/dir.go b/plumbing/format/gitignore/dir.go index 922c458..7cea50c 100644 --- a/plumbing/format/gitignore/dir.go +++ b/plumbing/format/gitignore/dir.go @@ -5,7 +5,6 @@ import ( "bytes" "io/ioutil" "os" - "os/user" "strings" "github.com/go-git/go-billy/v5" @@ -116,12 +115,12 @@ func loadPatterns(fs billy.Filesystem, path string) (ps []Pattern, err error) { // // The function assumes fs is rooted at the root filesystem. func LoadGlobalPatterns(fs billy.Filesystem) (ps []Pattern, err error) { - usr, err := user.Current() + home, err := os.UserHomeDir() if err != nil { return } - return loadPatterns(fs, fs.Join(usr.HomeDir, gitconfigFile)) + return loadPatterns(fs, fs.Join(home, gitconfigFile)) } // LoadSystemPatterns loads gitignore patterns from from the gitignore file |