diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go index 39909f573eaa..7dfef6755dd5 100644 --- a/pkg/sources/git/git.go +++ b/pkg/sources/git/git.go @@ -427,6 +427,9 @@ func executeClone(ctx context.Context, params cloneParams) (*git.Repository, err "-c", "remote.origin.fetch=+refs/*:refs/remotes/origin/*") } + if len(feature.UserAgentSuffix.Load()) > 0 { + gitArgs = append(gitArgs, "-c", fmt.Sprintf("http.userAgent=%s", "TruffleHog " + feature.UserAgentSuffix.Load())) + } gitArgs = append(gitArgs, params.args...) cloneCmd := exec.Command("git", gitArgs...)