mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Style missing worktree as red and display better error when trying to switch to them
Use a broken link icon for missing worktrees
This commit is contained in:
committed by
Jesse Duffield
parent
9a79154d05
commit
c679fd1924
@ -138,6 +138,10 @@ func (self *ReposHelper) CreateRecentReposMenu() error {
|
||||
}
|
||||
|
||||
func (self *ReposHelper) DispatchSwitchToRepo(path string, reuse bool) error {
|
||||
return self.DispatchSwitchTo(path, reuse, self.c.Tr.ErrRepositoryMovedOrDeleted)
|
||||
}
|
||||
|
||||
func (self *ReposHelper) DispatchSwitchTo(path string, reuse bool, errMsg string) error {
|
||||
env.UnsetGitDirEnvs()
|
||||
originalPath, err := os.Getwd()
|
||||
if err != nil {
|
||||
@ -146,7 +150,7 @@ func (self *ReposHelper) DispatchSwitchToRepo(path string, reuse bool) error {
|
||||
|
||||
if err := os.Chdir(path); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return self.c.ErrorMsg(self.c.Tr.ErrRepositoryMovedOrDeleted)
|
||||
return self.c.ErrorMsg(errMsg)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user