From c83168104b8bcb09e3e6e1490bd586a9e1a55bc3 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 31 Mar 2022 10:25:40 +0800 Subject: Use a more general (and faster) method to sanitize URLs with credentials (#19239) Use a more general method to sanitize URLs with credentials: Simple and intuitive / Faster / Remove all credentials in all URLs --- modules/git/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/git/command.go') diff --git a/modules/git/command.go b/modules/git/command.go index 8199498a2b..5d2e1dd67a 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -154,7 +154,7 @@ func (c *Command) RunWithContext(rc *RunContext) error { args = make([]string, len(c.args)) copy(args, c.args) for _, urlArgIndex := range argSensitiveURLIndexes { - args[urlArgIndex] = util.NewStringURLSanitizer(args[urlArgIndex], true).Replace(args[urlArgIndex]) + args[urlArgIndex] = util.SanitizeCredentialURLs(args[urlArgIndex]) } } desc = fmt.Sprintf("%s %s [repo_path: %s]", c.name, strings.Join(args, " "), rc.Dir) -- cgit v1.2.3