From 0d471653b5389029ab9126c35ea960b480114135 Mon Sep 17 00:00:00 2001 From: anotherbridge <46713015+anotherbridge@users.noreply.github.com> Date: Thu, 14 Jul 2022 14:20:55 +0200 Subject: [PATCH] Add fix for issue #915 (#916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André Breuer --- detect/git/git.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/detect/git/git.go b/detect/git/git.go index 4c76f8cb..bbbb4c1f 100644 --- a/detect/git/git.go +++ b/detect/git/git.go @@ -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") {