From a18e12bfc473e462fbbcc93f1c6ff9d3474701fe Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Tue, 9 Apr 2024 00:40:13 +0300 Subject: [PATCH] #8 change checkout. --- internal/source/gitlab/gitlab.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/source/gitlab/gitlab.go b/internal/source/gitlab/gitlab.go index 7ef1410..095fa6c 100644 --- a/internal/source/gitlab/gitlab.go +++ b/internal/source/gitlab/gitlab.go @@ -459,7 +459,9 @@ func checkout(w *git.Worktree, ref plumbing.Reference) { ctx := context.Background() logger.Debug(ctx, fmt.Sprintf("Checkout: %s", ref.Name().Short())) - if err := w.Checkout(&git.CheckoutOptions{Branch: ref.Name(), Create: false, Force: true}); err != nil { + if err := w.Checkout(&git.CheckoutOptions{ + Branch: plumbing.ReferenceName(ref.Name().String()), + }); err != nil { logger.Error(ctx, fmt.Sprintf("failed to reset: %v", err)) } }