1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-09 09:22:48 +03:00

branches check for split parts length

This commit is contained in:
mjarkk
2021-07-26 11:07:42 +02:00
parent 9b57b73f41
commit 3a0a9ec33b

View File

@@ -52,6 +52,12 @@ func (b *BranchListBuilder) obtainBranches() []*models.Branch {
} }
split := strings.Split(line, SEPARATION_CHAR) split := strings.Split(line, SEPARATION_CHAR)
if len(split) != 4 {
// Ignore line if it isn't separated into 4 parts
// This is probably a warning message, for more info see:
// https://github.com/jesseduffield/lazygit/issues/1385#issuecomment-885580439
continue
}
name := strings.TrimPrefix(split[1], "heads/") name := strings.TrimPrefix(split[1], "heads/")
branch := &models.Branch{ branch := &models.Branch{