From cf2b319914605fdb041ea5c13fd093ee22ad4854 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 9 Nov 2022 12:15:57 -0500 Subject: [PATCH] fix(git): skip reading files --- config/git.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/git.go b/config/git.go index 857a5898e..d1d4d6a3d 100644 --- a/config/git.go +++ b/config/git.go @@ -239,7 +239,7 @@ func (rs *RepoSource) LoadRepo(name string) error { rp := filepath.Join(rs.Path, name) r, err := rs.open(rp) if err != nil { - log.Printf("error opening repository %s: %s", name, err) + log.Printf("error opening repository %q: %s", rp, err) return err } rs.repos[name] = r @@ -253,6 +253,10 @@ func (rs *RepoSource) LoadRepos() error { return err } for _, de := range rd { + if !de.IsDir() { + log.Printf("warning: %q is not a directory", filepath.Join(rs.Path, de.Name())) + continue + } err = rs.LoadRepo(de.Name()) if err == git.ErrNotAGitRepository { continue