diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-18 23:26:02 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-18 23:26:02 +1100 |
commit | 0227b93409ea361e360c9a44095d937d73f4e19c (patch) | |
tree | 10ac64855fbf318690aab97f46da415d1c18f973 /pkg/commands | |
parent | b0ec0821d566c88f2b4cf192eaf31fead2074257 (diff) |
fix branch parserv0.17.0
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/branch_list_builder.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/commands/branch_list_builder.go b/pkg/commands/branch_list_builder.go index 553d2f1f9..89b28d030 100644 --- a/pkg/commands/branch_list_builder.go +++ b/pkg/commands/branch_list_builder.go @@ -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] |