1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +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:
Joel Baranick
2022-09-02 09:35:08 -07:00
committed by Jesse Duffield
parent 9a79154d05
commit c679fd1924
10 changed files with 103 additions and 85 deletions

View File

@ -638,16 +638,13 @@ func (self *RefreshHelper) refreshStatus() {
}
name := presentation.GetBranchTextStyle(currentBranch.Name).Sprint(currentBranch.Name)
var repoName string
worktreeName := self.worktreeHelper.GetCurrentWorktreeName()
if len(worktreeName) > 0 {
worktreeName = fmt.Sprintf("[%s]", worktreeName)
repoName = self.worktreeHelper.GetMainWorktreeName()
} else {
repoName = utils.GetCurrentRepoName()
repoName = utils.GetCurrentRepoName()
mainWorktreeName := self.worktreeHelper.GetMainWorktreeName()
if repoName != mainWorktreeName {
repoName = fmt.Sprintf("%s(%s)", mainWorktreeName, style.FgBlue.Sprint(repoName))
}
status += fmt.Sprintf("%s%s → %s ", repoName, worktreeName, name)
status += fmt.Sprintf("%s → %s ", repoName, name)
self.c.SetViewContent(self.c.Views().Status, status)
}