mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
handle ssh protocol
This commit is contained in:
parent
d9db5ccfbe
commit
4df003cc44
|
|
@ -12,8 +12,8 @@ import (
|
|||
// if you want to make a custom regex for a given service feel free to test it out
|
||||
// at regoio.herokuapp.com
|
||||
var defaultUrlRegexStrings = []string{
|
||||
`^https?://.*/(?P<owner>.*)/(?P<repo>.*?)(\.git)?$`,
|
||||
`^git@.*:(?P<owner>.*)/(?P<repo>.*?)(\.git)?$`,
|
||||
`^(?:https?|ssh)://.*/(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`,
|
||||
`^git@.*:(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`,
|
||||
}
|
||||
|
||||
// Service is a service that repository is on (Github, Bitbucket, ...)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,15 @@ func TestGetRepoInfoFromURL(t *testing.T) {
|
|||
assert.EqualValues(t, repoInfo.Repository, "super_calculator")
|
||||
},
|
||||
},
|
||||
{
|
||||
NewGithubService("github.com", "github.com"),
|
||||
"Returns repository information for ssh remote url",
|
||||
"ssh://git@github.com/petersmith/super_calculator",
|
||||
func(repoInfo *RepoInformation) {
|
||||
assert.EqualValues(t, repoInfo.Owner, "petersmith")
|
||||
assert.EqualValues(t, repoInfo.Repository, "super_calculator")
|
||||
},
|
||||
},
|
||||
{
|
||||
NewGithubService("github.com", "github.com"),
|
||||
"Returns repository information for http remote url",
|
||||
|
|
|
|||
Loading…
Reference in a new issue