File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -75,18 +75,18 @@ export async function getGitHubUrls(): Promise<GitHubUrls[] | null> {
7575 remote = [ r . state . remotes [ 0 ] ] ;
7676 }
7777
78- if ( remote . length > 0 && remote [ 0 ] . pushUrl ) {
79- const host = new URL ( remote [ 0 ] . pushUrl ) . host ;
80- const apiUri = new URL ( getGitHubApiUri ( ) ) . host ;
81- if ( host === "github.com" || ( useEnterprise ( ) && host === apiUri ) ) {
82- const url = remote [ 0 ] . pushUrl ;
83-
84- return {
85- workspaceUri : r . rootUri ,
86- url ,
87- protocol : new Protocol ( url )
88- } ;
89- }
78+ if (
79+ remote . length > 0 &&
80+ ( remote [ 0 ] . pushUrl ?. indexOf ( "github.com" ) !== - 1 ||
81+ ( useEnterprise ( ) && remote [ 0 ] . pushUrl ?. indexOf ( new URL ( getGitHubApiUri ( ) ) . host ) !== - 1 ) )
82+ ) {
83+ const url = remote [ 0 ] . pushUrl ;
84+
85+ return {
86+ workspaceUri : r . rootUri ,
87+ url,
88+ protocol : new Protocol ( url as string )
89+ } ;
9090 }
9191
9292 logDebug ( `Remote "${ remoteName } " not found, skipping repository` ) ;
You can’t perform that action at this time.
0 commit comments