Strip optional '.git' suffix from https server remote name.

This commit is contained in:
scott 2022-03-30 10:33:33 -07:00
parent 0dfc93c104
commit c2e9041213
2 changed files with 67 additions and 28 deletions

View file

@ -46,12 +46,14 @@ export function getRemoteDetail(remoteUrl: string): RemoteDetail {
throw new Error('Could not parse GitHub Server name')
}
remoteUrl = remoteUrl.replace(/\.git$/, '')
const httpsUrlPattern = new RegExp(
'^https?://.*@?' + githubServerMatch[1] + '/(.+/.+)$',
'i'
)
const sshUrlPattern = new RegExp(
'^git@' + githubServerMatch[1] + ':(.+/.+).git$',
'^git@' + githubServerMatch[1] + ':(.+/.+)$',
'i'
)