diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go index b8be0f50b88a..41e6a937687f 100644 --- a/pkg/sources/git/git.go +++ b/pkg/sources/git/git.go @@ -755,7 +755,7 @@ func PrepareRepoSinceCommit(ctx context.Context, uriString, commitHash string) ( } path, _, err = CloneRepoUsingToken(ctx, password, remotePath, uri.User.Username(), "--shallow-since", timestamp) if err != nil { - return path, true, fmt.Errorf("failed to clone authenticated Git repo (%s): %s", remotePath, err) + return path, true, fmt.Errorf("failed to clone authenticated Git repo (%s): %s", uri.Redacted(), err) } default: ctx.Logger().V(1).Info("cloning repo without authentication", "uri", uri) @@ -793,7 +793,7 @@ func PrepareRepo(ctx context.Context, uriString string) (string, bool, error) { } path, _, err = CloneRepoUsingToken(ctx, password, remotePath, uri.User.Username()) if err != nil { - return path, remote, fmt.Errorf("failed to clone authenticated Git repo (%s): %s", remotePath, err) + return path, remote, fmt.Errorf("failed to clone authenticated Git repo (%s): %s", uri.Redacted(), err) } default: ctx.Logger().V(1).Info("cloning repo without authentication", "uri", uri)