From bf946200e965cc36ce87fe88721ef6312a45fdf5 Mon Sep 17 00:00:00 2001 From: Corentin Rossignon Date: Wed, 26 Feb 2020 23:22:25 +0100 Subject: [PATCH] Fix OutOfBound array access when looking for ReflogCommits refs #679 --- pkg/commands/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 7aceb4610..1e4f1e990 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -1115,7 +1115,7 @@ func (c *GitCommand) GetReflogCommits() ([]*Commit, error) { re := regexp.MustCompile(`(\w+).*HEAD@\{\d+\}: (.*)`) for i, line := range lines { match := re.FindStringSubmatch(line) - if len(match) == 1 { + if len(match) <= 1 { continue }