Skip to content

Find, verify, and analyze leaked credentials

[chore] Log git output on error (#1180)

Miccahef9488c77d13
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index ebb47863f..2b9a25fd3 100644
--- a/pkg/sources/git/git.go
+++ b/pkg/sources/git/git.go
@@ -295,7 +295,7 @@ func CloneRepo(ctx context.Context, userInfo *url.Userinfo, gitUrl string, args
return "", nil, errors.New("clone command exited with no output")
}
if cloneCmd.ProcessState != nil && cloneCmd.ProcessState.ExitCode() != 0 {
- logger.V(1).Info("git clone failed", "error", err)
+ logger.V(1).Info("git clone failed", "output", output, "error", err)
return "", nil, fmt.Errorf("could not clone repo: %s, %w", safeUrl, err)
}