From 09ac74d205187a79f8d16af9244de4300d998c07 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Fri, 18 Feb 2022 11:17:43 +0100 Subject: [PATCH] fix: check out default branch from tags Also fix error handling to match function signatures. --- cli/catalogue/catalogue.go | 2 +- pkg/recipe/recipe.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/catalogue/catalogue.go b/cli/catalogue/catalogue.go index 8546bd3d..cb5bfa8f 100644 --- a/cli/catalogue/catalogue.go +++ b/cli/catalogue/catalogue.go @@ -138,7 +138,7 @@ keys configured on your account. internal.RegistryPassword, ) if err != nil { - logrus.Fatal(err) + logrus.Warn(err) } features, category, err := recipe.GetRecipeFeaturesAndCategory(recipeMeta.Name) diff --git a/pkg/recipe/recipe.go b/pkg/recipe/recipe.go index 80687a39..8c08cbdd 100644 --- a/pkg/recipe/recipe.go +++ b/pkg/recipe/recipe.go @@ -355,7 +355,7 @@ func EnsureLatest(recipeName string) error { return err } - branch, err := gitPkg.GetCurrentBranch(repo) + branch, err := GetDefaultBranch(repo, recipeName) if err != nil { return err } @@ -935,7 +935,7 @@ func GetRecipeVersions(recipeName, registryUsername, registryPassword string) (R worktree, err := repo.Worktree() if err != nil { - logrus.Fatal(err) + return versions, err } gitTags, err := repo.Tags() @@ -967,7 +967,7 @@ func GetRecipeVersions(recipeName, registryUsername, registryPassword string) (R cl, err := client.New("default") // only required for docker.io registry calls if err != nil { - logrus.Fatal(err) + return err } queryCache := make(map[reference.Named]string)