cf2b319914605fdb041ea5c13fd093ee22ad4854

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

fix(git): skip reading files

Diff

 1diff --git a/config/git.go b/config/git.go
 2index 857a5898ed970bb586042225cd5c84c5686055dd..d1d4d6a3de94bb2b7a5d6d8e47e6486e4bf88840 100644
 3--- a/config/git.go
 4+++ b/config/git.go
 5@@ -239,7 +239,7 @@ func (rs *RepoSource) LoadRepo(name string) error {
 6 	rp := filepath.Join(rs.Path, name)
 7 	r, err := rs.open(rp)
 8 	if err != nil {
 9-		log.Printf("error opening repository %s: %s", name, err)
10+		log.Printf("error opening repository %q: %s", rp, err)
11 		return err
12 	}
13 	rs.repos[name] = r
14@@ -253,6 +253,10 @@ func (rs *RepoSource) LoadRepos() error {
15 		return err
16 	}
17 	for _, de := range rd {
18+		if !de.IsDir() {
19+			log.Printf("warning: %q is not a directory", filepath.Join(rs.Path, de.Name()))
20+			continue
21+		}
22 		err = rs.LoadRepo(de.Name())
23 		if err == git.ErrNotAGitRepository {
24 			continue