@@ -49,15 +49,12 @@ import {
4949 resolveProjectSettings ,
5050} from "@t3tools/shared/projectSettings" ;
5151import {
52- detectSourceControlProviderFromGitRemoteUrl ,
5352 mergeGitStatusParts ,
54- normalizeGitRemoteUrl ,
5553 resolveAutoFeatureBranchName ,
5654 sanitizeBranchFragment ,
5755 sanitizeFeatureBranchName ,
5856} from "@t3tools/shared/git" ;
5957import {
60- canonicalRepositoryKey ,
6158 getChangeRequestTerminologyForKind ,
6259 isSshRemoteUrl ,
6360 type ChangeRequestTerminology ,
@@ -268,7 +265,7 @@ export function pullRequestRepositoryKey(value: string): string | null {
268265 url . pathname = match [ 1 ] ;
269266 url . search = "" ;
270267 url . hash = "" ;
271- return normalizeGitRemoteUrl ( url . toString ( ) ) ;
268+ return sourceControlClients . repositoryKeyFromRemote ( url . toString ( ) ) ;
272269 } catch {
273270 return null ;
274271 }
@@ -1027,8 +1024,10 @@ export const make = Effect.gen(function* () {
10271024 if (
10281025 remoteUrl === null ||
10291026 pullRequestKey === null ||
1030- canonicalRepositoryKey ( pullRequestKey ) !==
1031- canonicalRepositoryKey ( normalizeGitRemoteUrl ( remoteUrl ) )
1027+ sourceControlClients . canonicalRepositoryKey ( pullRequestKey ) !==
1028+ sourceControlClients . canonicalRepositoryKey (
1029+ sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) ,
1030+ )
10321031 ) {
10331032 return yield * cause ;
10341033 }
@@ -1451,7 +1450,7 @@ export const make = Effect.gen(function* () {
14511450 const baseUrl =
14521451 remote . remoteUrl === null
14531452 ? undefined
1454- : detectSourceControlProviderFromGitRemoteUrl ( remote . remoteUrl ) ?. baseUrl ;
1453+ : sourceControlClients . recognizeRemote ( remote . remoteUrl ) ?. baseUrl ;
14551454 const host = baseUrl === undefined ? null : urlHost ( baseUrl ) ;
14561455 const repository = remote . repositoryNameWithOwner ?. toLowerCase ( ) ;
14571456 const fromEnvironment = parseGitHubRepositorySelector ( environment . GH_REPO ?? "" , host ?? "" ) ;
@@ -1485,7 +1484,7 @@ export const make = Effect.gen(function* () {
14851484 ( yield * readConfigValueNullable ( cwd , `remote.${ preferredRemoteName } .url` ) ) ??
14861485 ( yield * readConfigValueNullable ( cwd , "remote.origin.url" ) ) ;
14871486
1488- const provider = remoteUrl ? detectSourceControlProviderFromGitRemoteUrl ( remoteUrl ) : null ;
1487+ const provider = remoteUrl ? sourceControlClients . recognizeRemote ( remoteUrl ) : null ;
14891488 if ( ! remoteUrl || provider ?. kind !== "unknown" ) return provider ;
14901489 const handle = yield * sourceControlProviders
14911490 . resolveHandle ( {
@@ -1516,7 +1515,7 @@ export const make = Effect.gen(function* () {
15161515 / ^ h t t p s ? : \/ \/ / iu. test ( remoteUrl ) &&
15171516 ( repositoryNameWithOwner ?. split ( "/" ) . length ?? 0 ) > 2
15181517 ) {
1519- const kind = detectSourceControlProviderFromGitRemoteUrl ( remoteUrl ) ?. kind ;
1518+ const kind = sourceControlClients . recognizeRemote ( remoteUrl ) ?. kind ;
15201519 const provider =
15211520 kind === undefined
15221521 ? undefined
@@ -1527,7 +1526,7 @@ export const make = Effect.gen(function* () {
15271526 }
15281527 return {
15291528 remoteUrl,
1530- remoteUrlKey : remoteUrl ? normalizeGitRemoteUrl ( remoteUrl ) : null ,
1529+ remoteUrlKey : remoteUrl ? sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) : null ,
15311530 repositoryNameWithOwner,
15321531 ownerLogin : parseRepositoryOwnerLogin ( repositoryNameWithOwner ) ,
15331532 } ;
@@ -2486,7 +2485,9 @@ export const make = Effect.gen(function* () {
24862485 remoteName === null
24872486 ? Effect . succeed ( null )
24882487 : readConfig ( `remote.${ remoteName } .url` ) . pipe (
2489- Effect . map ( ( remoteUrl ) => ( remoteUrl ? normalizeGitRemoteUrl ( remoteUrl ) : null ) ) ,
2488+ Effect . map ( ( remoteUrl ) =>
2489+ remoteUrl ? sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) : null ,
2490+ ) ,
24902491 ) ;
24912492 const remoteName = remoteNameOverride ?? ( yield * readConfig ( `branch.${ branch } .remote` ) ) ;
24922493 const [ headRemoteUrlKey , targetRemoteUrlKey ] =
0 commit comments