8000 Don't exit with error if git repacking is required (#1711) · gitleaks/gitleaks@3188ad6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3188ad6

Browse files
authored
Don't exit with error if git repacking is required (#1711)
Repacking writes a message to stderr but is not problematic. It is required quite often when using shallow/treeless clones, which is common in CI/CD environments. Fixes #1168.
1 parent 7fc11bb commit 3188ad6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
Collapse file: sources/git.go

sources/git.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ func listenForStdErr(stderr io.ReadCloser, errCh chan<- error) {
158158
// you may want to set your diff.renameLimit variable to at least
159159
// (some large number) and retry the command.
160160
//
161+
// Auto packing the repository in background for optimum performance.
162+
// See "git help gc" for manual housekeeping.
163+
//
161164
// we skip exiting the program as git log -p/git diff will continue
162165
// to send data to stdout and finish executing. This next bit of
163166
// code prevents gitleaks from stopping mid scan if this error is
@@ -167,7 +170,11 @@ func listenForStdErr(stderr io.ReadCloser, errCh chan<- error) {
167170
strings.Contains(scanner.Text(),
168171
"inexact rename detection was skipped") ||
169172
strings.Contains(scanner.Text(),
170-
"you may want to set your diff.renameLimit") {
173+
"you may want to set your diff.renameLimit") ||
174+
strings.Contains(scanner.Text(),
175+
"See \"git help gc\" for manual housekeeping") ||
176+
strings.Contains(scanner.Text(),
177+
"Auto packing the repository in background for optimum performance") {
171178
logging.Warn().Msg(scanner.Text())
172179
} else {
173180
logging.Error().Msgf("[git] %s", scanner.Text())

0 commit comments

Comments
 (0)
0