File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
plus/integrations/providers/azure Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { Source } from '../../constants.telemetry';
44import type { Container } from '../../container' ;
55import { HostingIntegration } from '../../plus/integrations/integration' ;
66import { remoteProviderIdToIntegrationId } from '../../plus/integrations/integrationService' ;
7- import { parseAzureHttpsUrl } from '../../plus/integrations/providers/azure/models' ;
7+ import { isVsts , parseAzureHttpsUrl } from '../../plus/integrations/providers/azure/models' ;
88import type { Brand , Unbrand } from '../../system/brand' ;
99import type { CreatePullRequestRemoteResource } from '../models/remoteResource' ;
1010import type { Repository } from '../models/repository' ;
@@ -122,6 +122,20 @@ export class AzureDevOpsRemote extends RemoteProvider {
122122 return 'Azure DevOps' ;
123123 }
124124
125+ override get owner ( ) : string | undefined {
126+ if ( isVsts ( this . domain ) ) {
127+ return this . domain . split ( '.' ) [ 0 ] ;
128+ }
129+ return super . owner ;
130+ }
131+
132+ override get repoName ( ) : string | undefined {
133+ if ( isVsts ( this . domain ) ) {
134+ return this . path ;
135+ }
136+ return super . repoName ;
137+ }
138+
125139 override get providerDesc ( ) :
126140 | {
127141 id : GkProviderId ;
Original file line number Diff line number Diff line change @@ -332,6 +332,9 @@ export function getAzureOwner(url: URL): string {
332332 const isVSTS = vstsHostnameRegex . test ( url . hostname ) ;
333333 return isVSTS ? getVSTSOwner ( url ) : getAzureDevOpsOwner ( url ) ;
334334}
335+ export function isVsts ( domain : string ) : boolean {
336+ return vstsHostnameRegex . test ( domain ) ;
337+ }
335338
336339export function getAzureRepo ( pr : AzurePullRequest ) : string {
337340 return `${ pr . repository . project . name } /_git/${ pr . repository . name } ` ;
You can’t perform that action at this time.
0 commit comments