mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
fix branch parser
This commit is contained in:
parent
b0ec0821d5
commit
0227b93409
1 changed files with 5 additions and 2 deletions
|
@ -51,8 +51,11 @@ func (b *BranchListBuilder) obtainBranches() []*Branch {
|
|||
|
||||
trimmedOutput := strings.TrimSpace(output)
|
||||
outputLines := strings.Split(trimmedOutput, "\n")
|
||||
branches := make([]*Branch, len(outputLines))
|
||||
for i, line := range outputLines {
|
||||
if len(outputLines) <= 1 {
|
||||
return []*Branch{}
|
||||
}
|
||||
branches := make([]*Branch, len(outputLines)-1)
|
||||
for i, line := range outputLines[1:] {
|
||||
split := strings.Split(line, SEPARATION_CHAR)
|
||||
|
||||
name := split[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue