summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorMark Kopenga <mkopenga@gmail.com>2021-07-26 11:22:33 +0200
committerGitHub <noreply@github.com>2021-07-26 11:22:33 +0200
commitf4874bbb74c7552216c189b2baa8d1a7a2b8efa1 (patch)
tree796a72785abeac7ffd91d504edd19ebf6aa1b5ce /pkg/commands
parenteec20b845da623310241ff98d44091bcfa15bd3e (diff)
parent3a0a9ec33bc37f006b7c242404f9a16c8092b4da (diff)
Merge pull request #1396 from mjarkk/fix-1385
branches check for split parts length
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/loading_branches.go6
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{