feat: recipe fetch command
Some checks reported errors
continuous-integration/drone/pr Build was killed
continuous-integration/drone/push Build was killed

Also may have rooted out another go-git cloning bug 🙄

Closes coop-cloud/organising#365
This commit is contained in:
2023-01-22 20:53:25 +01:00
parent 49865c6a97
commit 903aac9d7a
7 changed files with 163 additions and 109 deletions

View File

@ -10,9 +10,10 @@ import (
// Check if a branch exists in a repo. Use this and not repository.Branch(),
// because the latter does not actually check for existing branches. See
// https://github.com/go-git/go-git/issues/518 for more.
// https://github.com/gogit/gogit/issues/518 for more.
func HasBranch(repository *git.Repository, name string) bool {
var exist bool
if iter, err := repository.Branches(); err == nil {
iterFunc := func(reference *plumbing.Reference) error {
if name == reference.Name().Short() {
@ -23,6 +24,7 @@ func HasBranch(repository *git.Repository, name string) bool {
}
_ = iter.ForEach(iterFunc)
}
return exist
}