diff options
author | Mark Kopenga <mkopenga@gmail.com> | 2021-07-26 11:22:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 11:22:33 +0200 |
commit | f4874bbb74c7552216c189b2baa8d1a7a2b8efa1 (patch) | |
tree | 796a72785abeac7ffd91d504edd19ebf6aa1b5ce | |
parent | eec20b845da623310241ff98d44091bcfa15bd3e (diff) | |
parent | 3a0a9ec33bc37f006b7c242404f9a16c8092b4da (diff) |
Merge pull request #1396 from mjarkk/fix-1385
branches check for split parts length
-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{ |