Check that required info is present (#415)

This commit is contained in:
Bill Rich 2022-04-15 15:32:16 -08:00 committed by GitHub
parent 1f55171437
commit 09de492ec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -279,6 +279,10 @@ func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOp
var depth int64
var reachedBase = false
for file := range fileChan {
if file == nil || file.PatchHeader == nil {
log.Debugf("file missing patch header, skipping")
continue
}
log.WithField("commit", file.PatchHeader.SHA).WithField("file", file.NewName).Trace("Scanning file from git")
if scanOptions.MaxDepth > 0 && depth >= scanOptions.MaxDepth {
log.Debugf("reached max depth")