Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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("[email protected]:v3/dataapi-rclient", git = "external")
#> $url
#> [1] "[email protected]:v3/dataapi-rclient"
#> 
#> $subdir
#> NULL
#> 
#> $ref
#> NULL
#> 
#> attr(,"class")
#> [1] "xgit_remote" "remote"
remotes:::git_remote("[email protected]:group/package.git")
#> $url
#> [1] "[email protected]: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("[email protected]:group/package.git@v3")
#> $url
#> [1] "[email protected]: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
Development

Successfully merging this pull request may close these issues.

git_remote fails to parse gitlab urls with git protocol install_git() fails to install package from AzureDevOps with command status 128
2 participants