Git blame takes a long time to run. A natural optimization is to run git blame on multiple files concurrently. However, the existing implementation for idxfile uses Go's standard map data type which will cause "concurrent read and write to a map" run-time panic because of race conditions.
Signed-off-by: lxjhk lxjpub@gmail.com
Issue Addressed
Git blame takes a long time to run. A natural optimization is to run git blame on multiple files concurrently. However, the existing implementation for
idxfile
uses Go's standard map data type which will cause "concurrent read and write to a map" run-time panic because of race conditions.Ref Issues
https://github.com/zricethezav/gitleaks/issues/124#issue-373459034 https://github.com/src-d/go-git/issues/457#issue-239967754
Changes Made
Changed
map[int64]plumbing.Hash
tosync.Map