mirror of
https://github.com/aviator-co/av.git
synced 2025-12-18 10:34: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]
|
info := m.infos[branch]
|
||||||
|
|
||||||
var lines []string
|
titleLine := info.TitleLine
|
||||||
if !slices.Contains(m.adoptionTargets, branch) {
|
if titleLine == "" {
|
||||||
lines = append(lines, info.TitleLine)
|
titleLine = branch.Short()
|
||||||
} else if m.chosenTargets[branch] {
|
|
||||||
lines = append(lines, "[✓] "+info.TitleLine)
|
|
||||||
} else {
|
|
||||||
lines = append(lines, "[ ] "+info.TitleLine)
|
|
||||||
}
|
}
|
||||||
|
var prefix string
|
||||||
|
if slices.Contains(m.adoptionTargets, branch) {
|
||||||
|
if m.chosenTargets[branch] {
|
||||||
|
prefix = "[✓] "
|
||||||
|
} else {
|
||||||
|
prefix = "[ ] "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lines := []string{prefix + titleLine}
|
||||||
if info.Body != "" {
|
if info.Body != "" {
|
||||||
lines = append(lines, lipgloss.NewStyle().MarginLeft(4).Render(info.Body))
|
lines = append(lines, lipgloss.NewStyle().MarginLeft(4).Render(info.Body))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user