parent
2a88491d7c
commit
71a9155042
|
@ -24,6 +24,7 @@ import (
|
||||||
composetypes "github.com/docker/cli/cli/compose/types"
|
composetypes "github.com/docker/cli/cli/compose/types"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/docker/distribution/reference"
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
|
gitConfig "github.com/go-git/go-git/v5/config"
|
||||||
"github.com/go-git/go-git/v5/plumbing"
|
"github.com/go-git/go-git/v5/plumbing"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
@ -616,10 +617,18 @@ func EnsureUpToDate(recipeName string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchOpts := &git.FetchOptions{Tags: git.AllTags}
|
fmt.Println(branch)
|
||||||
|
fetchOpts := &git.FetchOptions{
|
||||||
|
Tags: git.AllTags,
|
||||||
|
RefSpecs: []gitConfig.RefSpec{
|
||||||
|
gitConfig.RefSpec(fmt.Sprintf("%s:%s", branch, branch)),
|
||||||
|
},
|
||||||
|
}
|
||||||
if err := repo.Fetch(fetchOpts); err != nil {
|
if err := repo.Fetch(fetchOpts); err != nil {
|
||||||
|
if !strings.Contains(err.Error(), "already up-to-date") {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
opts := &git.PullOptions{
|
opts := &git.PullOptions{
|
||||||
Force: true,
|
Force: true,
|
||||||
|
|
Loading…
Reference in New Issue