mirror of
https://github.com/aviator-co/av.git
synced 2025-12-17 18:14:13 -06:00
Fix a bug that already adopted branch names are not shown properly (#626)
This commit is contained in:
@@ -123,14 +123,19 @@ func (m *AdoptTreeSelectorModel) renderBranch(branch plumbing.ReferenceName, isT
|
||||
}
|
||||
info := m.infos[branch]
|
||||
|
||||
var lines []string
|
||||
if !slices.Contains(m.adoptionTargets, branch) {
|
||||
lines = append(lines, info.TitleLine)
|
||||
} else if m.chosenTargets[branch] {
|
||||
lines = append(lines, "[✓] "+info.TitleLine)
|
||||
} else {
|
||||
lines = append(lines, "[ ] "+info.TitleLine)
|
||||
titleLine := info.TitleLine
|
||||
if titleLine == "" {
|
||||
titleLine = branch.Short()
|
||||
}
|
||||
var prefix string
|
||||
if slices.Contains(m.adoptionTargets, branch) {
|
||||
if m.chosenTargets[branch] {
|
||||
prefix = "[✓] "
|
||||
} else {
|
||||
prefix = "[ ] "
|
||||
}
|
||||
}
|
||||
lines := []string{prefix + titleLine}
|
||||
if info.Body != "" {
|
||||
lines = append(lines, lipgloss.NewStyle().MarginLeft(4).Render(info.Body))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user