#8 change checkout.

This commit is contained in:
Gorbunov Kirill Andreevich 2024-04-09 00:40:13 +03:00
parent 85d580a63e
commit a18e12bfc4

View File

@ -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))
}
}