feat: recipe fetch command
Also may have rooted out another go-git cloning bug 🙄 Closes coop-cloud/organising#365
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user