Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regex that broke git@xxx in install-git #630

Merged
merged 2 commits into from Jun 23, 2021

Conversation

niheaven
Copy link
Contributor

The regex that fixed in #603 breaks git@xxx by accident 馃槶

It just try to handle @xxx as ref, change it from (?:(?<url>[^@]*))(?:@(?<ref>.*))?) to (?<url>(?:git@)?[^@]*)(?:@(?<ref>.*))? will fix the problem.

After fix:

remotes:::git_remote("git@ssh.dev.azure.com:v3/dataapi-rclient", git = "external")
#> $url
#> [1] "git@ssh.dev.azure.com:v3/dataapi-rclient"
#> 
#> $subdir
#> NULL
#> 
#> $ref
#> NULL
#> 
#> attr(,"class")
#> [1] "xgit_remote" "remote"
remotes:::git_remote("git@gitlab.company.com:group/package.git")
#> $url
#> [1] "git@gitlab.company.com:group/package.git"
#> 
#> $subdir
#> NULL
#> 
#> $ref
#> NULL
#> 
#> $credentials
#> NULL
#> 
#> attr(,"class")
#> [1] "git2r_remote" "remote"
remotes:::git_remote("https://gitlab.company.com/group/package.git@master") 
#> $url
#> [1] "https://gitlab.company.com/group/package.git"
#> 
#> $subdir
#> NULL
#> 
#> $ref
#> [1] "master"
#> 
#> $credentials
#> NULL
#> 
#> attr(,"class")
#> [1] "git2r_remote" "remote"
remotes:::git_remote("git@gitlab.company.com:group/package.git@v3")
#> $url
#> [1] "git@gitlab.company.com:group/package.git"
#> 
#> $subdir
#> NULL
#> 
#> $ref
#> [1] "v3"
#> 
#> $credentials
#> NULL
#> 
#> attr(,"class")
#> [1] "git2r_remote" "remote"

@jimhester jimhester merged commit 920e4a3 into r-lib:master Jun 23, 2021
@jimhester
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants