summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/worktrees_controller.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/controllers/worktrees_controller.go')
-rw-r--r--pkg/gui/controllers/worktrees_controller.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/gui/controllers/worktrees_controller.go b/pkg/gui/controllers/worktrees_controller.go
index e9d15c02a..b9982c8c8 100644
--- a/pkg/gui/controllers/worktrees_controller.go
+++ b/pkg/gui/controllers/worktrees_controller.go
@@ -1,6 +1,7 @@
package controllers
import (
+ "errors"
"fmt"
"strings"
"text/tabwriter"
@@ -117,11 +118,11 @@ func (self *WorktreesController) add() error {
func (self *WorktreesController) remove(worktree *models.Worktree) error {
if worktree.IsMain {
- return self.c.ErrorMsg(self.c.Tr.CantDeleteMainWorktree)
+ return errors.New(self.c.Tr.CantDeleteMainWorktree)
}
if worktree.IsCurrent {
- return self.c.ErrorMsg(self.c.Tr.CantDeleteCurrentWorktree)
+ return errors.New(self.c.Tr.CantDeleteCurrentWorktree)
}
return self.c.Helpers().Worktree.Remove(worktree, false)