mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-23 17:28:44 +00:00
closes https://github.com/argoproj/argo-cd/issues/6290 Signed-off-by: Blake Barnett <blakeb@me.com>
This commit is contained in:
parent
ffb22ff1ff
commit
ae5388dd79
1 changed files with 3 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -120,7 +121,8 @@ func WithEventHandlers(handlers EventHandlers) ClientOpts {
|
|||
}
|
||||
|
||||
func NewClient(rawRepoURL string, creds Creds, insecure bool, enableLfs bool, opts ...ClientOpts) (Client, error) {
|
||||
root := filepath.Join(os.TempDir(), strings.Replace(NormalizeGitURL(rawRepoURL), "/", "_", -1))
|
||||
r := regexp.MustCompile("(/|:)")
|
||||
root := filepath.Join(os.TempDir(), r.ReplaceAllString(NormalizeGitURL(rawRepoURL), "_"))
|
||||
if root == os.TempDir() {
|
||||
return nil, fmt.Errorf("Repository '%s' cannot be initialized, because its root would be system temp at %s", rawRepoURL, root)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue