Skip all binaries (#2256)

* Skip all binaries

* Remove noop

* Drop handlerOpts
This commit is contained in:
Bill Rich 2023-12-22 12:01:07 -08:00 committed by GitHub
parent 7d93adc1d0
commit ceff786db4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1009,13 +1009,9 @@ func (s *Git) handleBinary(ctx context.Context, gitDir string, reporter sources.
return nil
}
var handlerOpts []handlers.Option
if s.skipBinaries {
handlerOpts = append(handlerOpts, handlers.WithSkipBinaries(true))
if common.IsBinary(path) {
fileCtx.Logger().V(5).Info("skipping binary file")
return nil
}
fileCtx.Logger().V(5).Info("skipping binary file", "path", path)
return nil
}
if s.skipArchives {
@ -1057,7 +1053,7 @@ func (s *Git) handleBinary(ctx context.Context, gitDir string, reporter sources.
}
defer reader.Close()
if handlers.HandleFile(fileCtx, reader, chunkSkel, reporter, handlerOpts...) {
if handlers.HandleFile(fileCtx, reader, chunkSkel, reporter) {
return nil
}