Closed johnstcn closed 3 months ago
the issue comes from CloneRepo method. url.Parse is not a good solution for git url. Would this package a solution? https://pkg.go.dev/github.com/whilp/git-urls#section-documentation
I am on a fix right now because i need the ssh clone.
More context after talking to @johnstcn about this issue:
There are two places we parse git URLs right now apart from test code:
DefaultWorkspaceFolder()
(envbuilder.go#L858) -- in this case we are only interested in the "name" of the repo, which we can probably get without parsing the URL completely.CloneRepo()
(git.go#L48) -- in this case there's a couple of things we do with the parsed URL (check for dev.azure.com, checking URL fragment for reference name), both of which are probably possible without calling url.Parse()We could also use the library suggested, but my preference is to avoid extra imports if possible.
We cannot assume that anything folks pass to GIT_URL will be a valid URL.
Example: