fix: if no remotes, skip on

This commit is contained in:
decentral1se 2021-12-25 14:59:58 +01:00
parent decfe095fe
commit 6937bfbb0d
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 10 additions and 0 deletions

View File

@ -309,6 +309,16 @@ func EnsureUpToDate(recipeName string) error {
return err
}
remotes, err := repo.Remotes()
if err != nil {
return err
}
if len(remotes) == 0 {
logrus.Debugf("cannot ensure %s is up-to-date, no git remotes configured", recipeName)
return nil
}
opts := &git.PullOptions{
ReferenceName: plumbing.ReferenceName(branch),
}