5149978832d379c611b81cc0e6e029bb17469bb6

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

Message

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

Skip loading repos with broken head ref.

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

Diff

 1diff --git a/config/git.go b/config/git.go
 2index 9c36f18955dd143592412746ed472d0727c86d40..9835a4f1d9d8a06ec9f00bc603c7d8685ca2dd94 100644
 3--- a/config/git.go
 4+++ b/config/git.go
 5@@ -240,7 +240,6 @@ 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.Error("error opening repository", "path", rp, "err", err)
10 		return err
11 	}
12 	rs.repos[name] = r
13@@ -263,7 +262,8 @@ func (rs *RepoSource) LoadRepos() error {
14 			continue
15 		}
16 		if err != nil {
17-			return err
18+			log.Warn("error loading repository", "path", filepath.Join(rs.Path, de.Name()), "err", err)
19+			continue
20 		}
21 	}
22 	return nil