@@ -17,7 +17,9 @@ const fileRegex = /path=([^&]+)/i;
1717const rangeRegex = / l i n e = ( \d + ) (?: & l i n e E n d = ( \d + ) ) ? / ;
1818
1919export class AzureDevOpsRemote extends RemoteProvider {
20+ private readonly project : string | undefined ;
2021 constructor ( domain : string , path : string , protocol ?: string , name ?: string , legacy : boolean = false ) {
22+ let repoProject ;
2123 if ( sshDomainRegex . test ( domain ) ) {
2224 path = path . replace ( sshPathRegex , '' ) ;
2325 domain = domain . replace ( sshDomainRegex , '' ) ;
@@ -27,6 +29,8 @@ export class AzureDevOpsRemote extends RemoteProvider {
2729 if ( match != null ) {
2830 const [ , org , project , rest ] = match ;
2931
32+ repoProject = project ;
33+
3034 // Handle legacy vsts urls
3135 if ( legacy ) {
3236 domain = `${ org } .${ domain } ` ;
@@ -35,13 +39,21 @@ export class AzureDevOpsRemote extends RemoteProvider {
3539 path = `${ org } /${ project } /_git/${ rest } ` ;
3640 }
3741 }
42+ } else {
43+ const match = orgAndProjectRegex . exec ( path ) ;
44+ if ( match != null ) {
45+ const [ , , project ] = match ;
46+
47+ repoProject = project ;
48+ }
3849 }
3950
4051 // Azure DevOps allows projects and repository names with spaces. In that situation,
4152 // the `path` will be previously encoded during git clone
4253 // revert that encoding to avoid double-encoding by gitlens during copy remote and open remote
4354 path = decodeURIComponent ( path ) ;
4455 super ( domain , path , protocol , name ) ;
56+ this . project = repoProject ;
4557 }
4658
4759 private _autolinks : ( AutolinkReference | DynamicAutolinkReference ) [ ] | undefined ;
@@ -88,6 +100,26 @@ export class AzureDevOpsRemote extends RemoteProvider {
88100 return 'Azure DevOps' ;
89101 }
90102
103+ override get providerDesc ( ) :
104+ | {
105+ id : GkProviderId ;
106+ repoDomain : string ;
107+ repoName : string ;
108+ repoOwnerDomain : string ;
109+ }
110+ | undefined {
111+ if ( this . gkProviderId == null || this . owner == null || this . repoName == null || this . project == null ) {
112+ return undefined ;
113+ }
114+
115+ return {
116+ id : this . gkProviderId ,
117+ repoDomain : this . project ,
118+ repoName : this . repoName ,
119+ repoOwnerDomain : this . owner ,
120+ } ;
121+ }
122+
91123 private _displayPath : string | undefined ;
92124 override get displayPath ( ) : string {
93125 if ( this . _displayPath === undefined ) {
0 commit comments