Add fix for issue #915 (#916)

Co-authored-by: André Breuer <andre.breuer@ndaal.eu>
This commit is contained in:
anotherbridgeandAndré Breuer authored and GitHub committed 2022-07-14 07:20:55 -05:00
1 parent f615d0397d
commit 0d471653b5
1 file changed
+7 -1
+7 -1
View File
@@ -85,18 +85,24 @@ func listenForStdErr(stderr io.ReadCloser) {
scanner := bufio.NewScanner(stderr)
errEncountered := false
for scanner.Scan() {
// if git throws the following error:
// if git throws one of the following errors:
//
// exhaustive rename detection was skipped due to too many files.
// you may want to set your diff.renameLimit variable to at least
// (some large number) and retry the command.
//
// inexact rename detection was skipped due to too many files.
// you may want to set your diff.renameLimit variable to at least
// (some large number) and retry the command.
//
// we skip exiting the program as git log -p/git diff will continue
// to send data to stdout and finish executing. This next bit of
// code prevents gitleaks from stopping mid scan if this error is
// encountered
if strings.Contains(scanner.Text(),
"exhaustive rename detection was skipped") ||
strings.Contains(scanner.Text(),
"inexact rename detection was skipped") ||
strings.Contains(scanner.Text(),
"you may want to set your diff.renameLimit") {