fix: standardise checkout options
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
113bdf9e86
commit
ae32b1eed2
|
@ -405,7 +405,6 @@ func GetRecipeVersions(recipeName string) (RecipeVersions, error) {
|
||||||
checkOutOpts := &git.CheckoutOptions{
|
checkOutOpts := &git.CheckoutOptions{
|
||||||
Create: false,
|
Create: false,
|
||||||
Force: true,
|
Force: true,
|
||||||
Keep: false,
|
|
||||||
Branch: plumbing.ReferenceName(ref.Name()),
|
Branch: plumbing.ReferenceName(ref.Name()),
|
||||||
}
|
}
|
||||||
if err := worktree.Checkout(checkOutOpts); err != nil {
|
if err := worktree.Checkout(checkOutOpts); err != nil {
|
||||||
|
@ -467,7 +466,6 @@ func GetRecipeVersions(recipeName string) (RecipeVersions, error) {
|
||||||
checkOutOpts := &git.CheckoutOptions{
|
checkOutOpts := &git.CheckoutOptions{
|
||||||
Create: false,
|
Create: false,
|
||||||
Force: true,
|
Force: true,
|
||||||
Keep: false,
|
|
||||||
Branch: plumbing.ReferenceName(refName),
|
Branch: plumbing.ReferenceName(refName),
|
||||||
}
|
}
|
||||||
if err := worktree.Checkout(checkOutOpts); err != nil {
|
if err := worktree.Checkout(checkOutOpts); err != nil {
|
||||||
|
|
|
@ -62,7 +62,6 @@ func EnsureUpToDate(dir string) error {
|
||||||
checkOutOpts := &git.CheckoutOptions{
|
checkOutOpts := &git.CheckoutOptions{
|
||||||
Create: false,
|
Create: false,
|
||||||
Force: true,
|
Force: true,
|
||||||
Keep: false,
|
|
||||||
Branch: plumbing.ReferenceName(refName),
|
Branch: plumbing.ReferenceName(refName),
|
||||||
}
|
}
|
||||||
if err := worktree.Checkout(checkOutOpts); err != nil {
|
if err := worktree.Checkout(checkOutOpts); err != nil {
|
||||||
|
|
|
@ -142,7 +142,11 @@ func EnsureVersion(recipeName, version string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := &git.CheckoutOptions{Branch: tagRef, Keep: true}
|
opts := &git.CheckoutOptions{
|
||||||
|
Branch: tagRef,
|
||||||
|
Create: false,
|
||||||
|
Force: true,
|
||||||
|
}
|
||||||
if err := worktree.Checkout(opts); err != nil {
|
if err := worktree.Checkout(opts); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -181,7 +185,6 @@ func EnsureLatest(recipeName string) error {
|
||||||
checkOutOpts := &git.CheckoutOptions{
|
checkOutOpts := &git.CheckoutOptions{
|
||||||
Create: false,
|
Create: false,
|
||||||
Force: true,
|
Force: true,
|
||||||
Keep: false,
|
|
||||||
Branch: plumbing.ReferenceName(refName),
|
Branch: plumbing.ReferenceName(refName),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue