feat: Support alternate SSH usernames i.e. non-standard GitHub Enterprise setups
This commit is contained in:
parent
cdca4f17db
commit
8ee6a3cf3b
1 changed files with 2 additions and 1 deletions
|
|
@ -37,8 +37,9 @@ function M.parse_gh_remote(url)
|
||||||
-- ssh url can be of type:
|
-- ssh url can be of type:
|
||||||
-- git@some.github.com:user_or_org/reponame.git
|
-- git@some.github.com:user_or_org/reponame.git
|
||||||
-- ssh://git@some.github.com/user_or_org/reponame.git
|
-- ssh://git@some.github.com/user_or_org/reponame.git
|
||||||
|
-- ssh://org-12345@some.github.com/org/reponame.git
|
||||||
-- .* is used for ssh:// since lua matching doesn't support optional groups, only chars
|
-- .* is used for ssh:// since lua matching doesn't support optional groups, only chars
|
||||||
local ssh = { string.find(url, ".*git@(.*)[:/]([^/]*)/([^%s/]*)") }
|
local ssh = { string.find(url, ".*@(.*)[:/]([^/]*)/([^%s/]*)") }
|
||||||
|
|
||||||
local matches = http[1] == nil and ssh or http
|
local matches = http[1] == nil and ssh or http
|
||||||
if matches[1] == nil then
|
if matches[1] == nil then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue