1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Alert when attempting to enter the current worktree

This commit is contained in:
Jesse Duffield
2023-07-16 11:20:22 +10:00
parent 796945aad0
commit 03f726038e
2 changed files with 6 additions and 0 deletions

View File

@ -140,6 +140,10 @@ func (self *WorktreesController) GetOnClick() func() error {
}
func (self *WorktreesController) enter(worktree *models.Worktree) error {
if self.c.Git().Worktree.IsCurrentWorktree(worktree) {
return self.c.ErrorMsg(self.c.Tr.AlreadyInWorktree)
}
// if we were in a submodule, we want to forget about that stack of repos
// so that hitting escape in the new repo does nothing
self.c.State().GetRepoPathStack().Clear()