diff options
| author | pasha-codefresh <pavel@codefresh.io> | 2024-05-28 21:09:35 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-28 21:09:35 +0300 |
| commit | bb590d50ae5931e5dbf41f8fd6d4a30f92e22e9e (patch) | |
| tree | b1b7d6cfede237200208444e8d015a991ea4d51c /ext/git/git.go | |
| parent | eb1d8d30bb22cb82928df64fd5028fa978f8cb5b (diff) | |
| parent | 51db19fcaaff26b3d53e4e63ddb1e4ef0f3cd695 (diff) | |
Merge pull request #726 from jannfis/chore/update-git-client-2_11
chore(deps): Pull in Git client changes from Argo CD v2.11.2
Diffstat (limited to 'ext/git/git.go')
| -rw-r--r-- | ext/git/git.go | 10 |
1 files changed, 1 insertions, 9 deletions
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 "" |
