fix(config): ignore repos with broken head ref (#236)

Ayman Bagabas created

Skip loading repos with broken head ref.

Fixes: https://github.com/charmbracelet/soft-serve/issues/235

Change summary

config/git.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

config/git.go 🔗

@@ -240,7 +240,6 @@ func (rs *RepoSource) LoadRepo(name string) error {
 	rp := filepath.Join(rs.Path, name)
 	r, err := rs.open(rp)
 	if err != nil {
-		log.Error("error opening repository", "path", rp, "err", err)
 		return err
 	}
 	rs.repos[name] = r
@@ -263,7 +262,8 @@ func (rs *RepoSource) LoadRepos() error {
 			continue
 		}
 		if err != nil {
-			return err
+			log.Warn("error loading repository", "path", filepath.Join(rs.Path, de.Name()), "err", err)
+			continue
 		}
 	}
 	return nil