66
normalizedRemoteUrl = `https://${host}${path}`;
67
}
69
>
const normalizedHost = host.toLowerCase();
70
>
const normalizedHostname = normalizedHost.replace(/:\d+$/, '');
71
>
const normalizedPath = path.replace(/^\/+|\/+$/g, '');
72
>
if (normalizedHostname === 'github.com' || normalizedHost === enterpriseHost?.toLowerCase() || normalizedHostname === 'ghe.com' || normalizedHostname.endsWith('.ghe.com')) {
73
>
const match = /^(?<owner>[^/]+)\/(?<repo>[^/]+?)(?:\.git)?$/i.exec(normalizedPath);
74
>
if (!match?.groups) {
75
return undefined;
76
}
78
>
remoteUrl: normalizedRemoteUrl,
79
>
repoId: `${match.groups['owner']}/${match.groups['repo']}`.toLowerCase(),
80
>
repoType: 'github',
81
>
};
82
>
}
83
84
let adoMatch: RegExpExecArray | null = null;