summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers/worktree_helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/controllers/helpers/worktree_helper.go')
-rw-r--r--pkg/gui/controllers/helpers/worktree_helper.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/gui/controllers/helpers/worktree_helper.go b/pkg/gui/controllers/helpers/worktree_helper.go
index 02df23398..7c763e0fb 100644
--- a/pkg/gui/controllers/helpers/worktree_helper.go
+++ b/pkg/gui/controllers/helpers/worktree_helper.go
@@ -1,6 +1,7 @@
package helpers
import (
+ "errors"
"strings"
"github.com/jesseduffield/gocui"
@@ -139,7 +140,7 @@ func (self *WorktreeHelper) NewWorktreeCheckout(base string, canCheckoutBase boo
Title: self.c.Tr.NewBranchName,
HandleConfirm: func(branchName string) error {
if branchName == "" {
- return self.c.ErrorMsg(self.c.Tr.BranchNameCannotBeBlank)
+ return errors.New(self.c.Tr.BranchNameCannotBeBlank)
}
opts.Branch = branchName
@@ -154,7 +155,7 @@ func (self *WorktreeHelper) NewWorktreeCheckout(base string, canCheckoutBase boo
func (self *WorktreeHelper) Switch(worktree *models.Worktree, contextKey types.ContextKey) error {
if worktree.IsCurrent {
- return self.c.ErrorMsg(self.c.Tr.AlreadyInWorktree)
+ return errors.New(self.c.Tr.AlreadyInWorktree)
}
self.c.LogAction(self.c.Tr.SwitchToWorktree)
@@ -192,7 +193,7 @@ func (self *WorktreeHelper) Remove(worktree *models.Worktree, force bool) error
if !force {
return self.Remove(worktree, true)
}
- return self.c.ErrorMsg(errMessage)
+ return err
}
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.WORKTREES, types.BRANCHES, types.FILES}})
})