mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Remove IO logic from presentation code for worktrees
We're doing all the IO in our workers loader method so that we don't need to do any in our presentation code
This commit is contained in:
@ -72,7 +72,7 @@ func (self *WorktreesController) GetOnRenderToMain() func() error {
|
||||
}
|
||||
|
||||
missing := ""
|
||||
if self.c.Git().Worktree.IsWorktreePathMissing(worktree.Path) {
|
||||
if worktree.PathMissing() {
|
||||
missing = style.FgRed.Sprintf(" %s", self.c.Tr.MissingWorktree)
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ func (self *WorktreesController) remove(worktree *models.Worktree) error {
|
||||
return self.c.ErrorMsg(self.c.Tr.CantDeleteMainWorktree)
|
||||
}
|
||||
|
||||
if self.c.Git().Worktree.IsCurrentWorktree(worktree.Path) {
|
||||
if worktree.Current() {
|
||||
return self.c.ErrorMsg(self.c.Tr.CantDeleteCurrentWorktree)
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ func (self *WorktreesController) GetOnClick() func() error {
|
||||
}
|
||||
|
||||
func (self *WorktreesController) enter(worktree *models.Worktree) error {
|
||||
return self.c.Helpers().Worktree.Switch(worktree.Path, context.WORKTREES_CONTEXT_KEY)
|
||||
return self.c.Helpers().Worktree.Switch(worktree, context.WORKTREES_CONTEXT_KEY)
|
||||
}
|
||||
|
||||
func (self *WorktreesController) open(worktree *models.Worktree) error {
|
||||
|
Reference in New Issue
Block a user