fix: only strip optional '.git' suffix from https server remote name and not 'Xgit'

This commit is contained in:
campersau 2022-09-22 09:20:11 +02:00
parent 3f9dbd5a76
commit 510f2b2e18
3 changed files with 1319 additions and 1301 deletions

View file

@ -47,11 +47,11 @@ export function getRemoteDetail(remoteUrl: string): RemoteDetail {
}
const httpsUrlPattern = new RegExp(
'^https?://.*@?' + githubServerMatch[1] + '/(.+/.+?)(.git)?$',
'^https?://.*@?' + githubServerMatch[1] + '/(.+/.+?)(\\.git)?$',
'i'
)
const sshUrlPattern = new RegExp(
'^git@' + githubServerMatch[1] + ':(.+/.+).git$',
'^git@' + githubServerMatch[1] + ':(.+/.+)\\.git$',
'i'
)