Merge pull request #7273 from frankffenn/fix/commit-batch-panic

fix index out of range
This commit is contained in:
Łukasz Magiera 2021-09-06 10:24:42 -07:00 committed by GitHub
commit ff12fd3a61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -297,6 +297,10 @@ func (b *CommitBatcher) processBatch(cfg sealiface.Config) ([]sealiface.CommitBa
infos = append(infos, p.Info)
}
if len(infos) == 0 {
return nil, nil
}
sort.Slice(infos, func(i, j int) bool {
return infos[i].Number < infos[j].Number
})