From 67f3d349f9fb60bb232cf6f0734a090bc48f5a4e Mon Sep 17 00:00:00 2001 From: jannfis Date: Mon, 27 May 2024 19:38:30 +0000 Subject: chore(deps): Pull in Git client changes from Argo CD v2.11.2 Signed-off-by: jannfis --- ext/git/git.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'ext/git/git.go') diff --git a/ext/git/git.go b/ext/git/git.go index b925789..d5a8652 100644 --- a/ext/git/git.go +++ b/ext/git/git.go @@ -14,14 +14,6 @@ func ensurePrefix(s, prefix string) string { return s } -// removeSuffix idempotently removes a given suffix -func removeSuffix(s, suffix string) string { - if strings.HasSuffix(s, suffix) { - return s[0 : len(s)-len(suffix)] - } - return s -} - var ( commitSHARegex = regexp.MustCompile("^[0-9A-Fa-f]{40}$") sshURLRegex = regexp.MustCompile("^(ssh://)?([^/:]*?)@[^@]+$") @@ -62,7 +54,7 @@ func NormalizeGitURL(repo string) string { repo = ensurePrefix(repo, "ssh://") } } - repo = removeSuffix(repo, ".git") + repo = strings.TrimSuffix(repo, ".git") repoURL, err := url.Parse(repo) if err != nil { return "" -- cgit v1.2.3