This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
src/GitHub.TeamFoundation.14/Services Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,35 @@ public void ShowHomePage()
6767
6868 public void ShowPublishSection ( )
6969 {
70- #if TEAMEXPLORER14 || TEAMEXPLORER15
70+ #if TEAMEXPLORER16
71+ // Only call InitializeOrPushRepositoryToGitService when IGitActionsExt2 exists
72+ if ( FindIGitActionsExt2 ( ) is object )
73+ {
74+ InitializeOrPushRepositoryToGitService ( ) ;
75+ return ;
76+ }
77+ #endif
78+
7179 var te = serviceProvider . TryGetService < ITeamExplorer > ( ) ;
7280 var page = te . NavigateToPage ( new Guid ( TeamExplorerPageIds . GitCommits ) , null ) ;
7381 var publish = page ? . GetSection ( new Guid ( GitHubPublishSection . GitHubPublishSectionId ) ) as GitHubPublishSection ;
7482 publish ? . Connect ( ) ;
75- #else
83+ }
84+
85+ #if TEAMEXPLORER16
86+ private static Type FindIGitActionsExt2 ( )
87+ {
88+ Type type = typeof ( IGitActionsExt ) ;
89+ string name = $ "{ type . FullName } 2";
90+ return type . Assembly . GetType ( name , false ) ;
91+ }
92+
93+ private void InitializeOrPushRepositoryToGitService ( )
94+ {
7695 IGitActionsExt2 gitActionsExt = serviceProvider . TryGetService < IGitActionsExt2 > ( ) ;
7796 gitActionsExt ? . InitializeOrPushRepositoryToGitService ( ) ;
78- #endif
7997 }
98+ #endif
8099
81100 public async Task ShowRepositorySettingsRemotesAsync ( )
82101 {
You can’t perform that action at this time.
0 commit comments