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()
67
67
68
68
public void ShowPublishSection ( )
69
69
{
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
+
71
79
var te = serviceProvider . TryGetService < ITeamExplorer > ( ) ;
72
80
var page = te . NavigateToPage ( new Guid ( TeamExplorerPageIds . GitCommits ) , null ) ;
73
81
var publish = page ? . GetSection ( new Guid ( GitHubPublishSection . GitHubPublishSectionId ) ) as GitHubPublishSection ;
74
82
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
+ {
76
95
IGitActionsExt2 gitActionsExt = serviceProvider . TryGetService < IGitActionsExt2 > ( ) ;
77
96
gitActionsExt ? . InitializeOrPushRepositoryToGitService ( ) ;
78
- #endif
79
97
}
98
+ #endif
80
99
81
100
public async Task ShowRepositorySettingsRemotesAsync ( )
82
101
{
You can’t perform that action at this time.
0 commit comments