mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-02 23:27:32 +02:00
Alert when attempting to enter the current worktree
This commit is contained in:
parent
796945aad0
commit
03f726038e
@ -140,6 +140,10 @@ func (self *WorktreesController) GetOnClick() func() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *WorktreesController) enter(worktree *models.Worktree) 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
|
// 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
|
// so that hitting escape in the new repo does nothing
|
||||||
self.c.State().GetRepoPathStack().Clear()
|
self.c.State().GetRepoPathStack().Clear()
|
||||||
|
@ -550,6 +550,7 @@ type TranslationSet struct {
|
|||||||
DeleteWorktreePrompt string
|
DeleteWorktreePrompt string
|
||||||
ForceDeleteWorktreePrompt string
|
ForceDeleteWorktreePrompt string
|
||||||
CantDeleteCurrentWorktree string
|
CantDeleteCurrentWorktree string
|
||||||
|
AlreadyInWorktree string
|
||||||
CantDeleteMainWorktree string
|
CantDeleteMainWorktree string
|
||||||
NoWorktreesThisRepo string
|
NoWorktreesThisRepo string
|
||||||
MissingWorktree string
|
MissingWorktree string
|
||||||
@ -1268,6 +1269,7 @@ func EnglishTranslationSet() TranslationSet {
|
|||||||
DeleteWorktreePrompt: "Are you sure you want to delete worktree '{{.worktreeName}}'?",
|
DeleteWorktreePrompt: "Are you sure you want to delete worktree '{{.worktreeName}}'?",
|
||||||
ForceDeleteWorktreePrompt: "'{{.worktreeName}}' is not fully merged. Are you sure you want to delete it?",
|
ForceDeleteWorktreePrompt: "'{{.worktreeName}}' is not fully merged. Are you sure you want to delete it?",
|
||||||
CantDeleteCurrentWorktree: "You cannot delete the current worktree!",
|
CantDeleteCurrentWorktree: "You cannot delete the current worktree!",
|
||||||
|
AlreadyInWorktree: "You are already in the selected worktree",
|
||||||
CantDeleteMainWorktree: "You cannot delete the main worktree!",
|
CantDeleteMainWorktree: "You cannot delete the main worktree!",
|
||||||
NoWorktreesThisRepo: "No worktrees",
|
NoWorktreesThisRepo: "No worktrees",
|
||||||
MissingWorktree: "(missing)",
|
MissingWorktree: "(missing)",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user