diff options
Diffstat (limited to 'gitignore.go')
| -rw-r--r-- | gitignore.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gitignore.go b/gitignore.go index f6816bd..80d14a6 100644 --- a/gitignore.go +++ b/gitignore.go @@ -10,13 +10,9 @@ import ( func loadGitignore(hostDir string) (*ignore.GitIgnore, error) { gitignorePath := filepath.Join(hostDir, ".gitignore") - data, err := os.ReadFile(gitignorePath) - if err != nil { - if os.IsNotExist(err) { - return ignore.CompileIgnoreLines(), nil - } - return nil, err + if _, err := os.Stat(gitignorePath); os.IsNotExist(err) { + return ignore.CompileIgnoreLines(), nil } - return ignore.CompileIgnoreLines(string(data)), nil + return ignore.CompileIgnoreFile(gitignorePath) } |
