diff options
author | mjarkk <mkopenga@gmail.com> | 2021-07-26 11:07:42 +0200 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2021-07-26 11:07:42 +0200 |
commit | 3a0a9ec33bc37f006b7c242404f9a16c8092b4da (patch) | |
tree | e1f3b3235734905b62d32a54e5648a564784166a /pkg | |
parent | 9b57b73f41fb40acd88b941aaa6a256761be0a3a (diff) |
branches check for split parts length
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/loading_branches.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/commands/loading_branches.go b/pkg/commands/loading_branches.go index 67ad1c89d..7565a9aee 100644 --- a/pkg/commands/loading_branches.go +++ b/pkg/commands/loading_branches.go @@ -52,6 +52,12 @@ func (b *BranchListBuilder) obtainBranches() []*models.Branch { } 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/") branch := &models.Branch{ |