fix: dont throw away changes

Part of coop-cloud/organising#226.
This commit is contained in:
2021-11-22 21:11:59 +01:00
parent aea5cc69c3
commit dd0f328a65
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -525,7 +525,7 @@ func GetRecipeVersions(recipeName string) (RecipeVersions, error) {
checkOutOpts := &git.CheckoutOptions{
Create: false,
Force: true,
Keep: true,
Branch: plumbing.ReferenceName(ref.Name()),
}
if err := worktree.Checkout(checkOutOpts); err != nil {
@@ -586,7 +586,7 @@ func GetRecipeVersions(recipeName string) (RecipeVersions, error) {
refName := fmt.Sprintf("refs/heads/%s", branch)
checkOutOpts := &git.CheckoutOptions{
Create: false,
Force: true,
Keep: true,
Branch: plumbing.ReferenceName(refName),
}
if err := worktree.Checkout(checkOutOpts); err != nil {
+1 -1
View File
@@ -76,7 +76,7 @@ func EnsureUpToDate(dir string) error {
refName := fmt.Sprintf("refs/heads/%s", branch)
checkOutOpts := &git.CheckoutOptions{
Create: false,
Force: true,
Keep: true,
Branch: plumbing.ReferenceName(refName),
}
if err := worktree.Checkout(checkOutOpts); err != nil {
+2 -2
View File
@@ -168,7 +168,7 @@ func EnsureVersion(recipeName, version string) error {
opts := &git.CheckoutOptions{
Branch: tagRef,
Create: false,
Force: true,
Keep: true,
}
if err := worktree.Checkout(opts); err != nil {
return err
@@ -220,7 +220,7 @@ func EnsureLatest(recipeName string) error {
refName := fmt.Sprintf("refs/heads/%s", branch)
checkOutOpts := &git.CheckoutOptions{
Create: false,
Force: true,
Keep: true,
Branch: plumbing.ReferenceName(refName),
}